Problem 61. Find state names that end with the letter A
Given a list of US states, remove all the states that end with the letter A.
Example:
Input s1 = 'Alabama Montana Nebraska Vermont Nevada'; Output s2 is ' Vermont ';
Solution Stats
Problem Comments
-
10 Comments
Show
7 older comments
Bryan Lambo
on 3 Jan 2020
Be careful of the 2-word states.
Converting to different formats boggles me
Peter
on 13 Feb 2023
I don't want to go through to effort to solve such a irrelevant problem!
I will cheat!
if (s1{id}(1) == 'W' & s1{id}(end) == 't') | s1{id}(end) == 'h'
% Do nothing...
Yacine
on 5 Oct 2024
bruh matlab stands for matrix laboratory, not states with the letter A remover lmao
Solution Comments
Show commentsProblem Recent Solvers1186
Suggested Problems
-
272 Solvers
-
Project Euler: Problem 2, Sum of even Fibonacci
2501 Solvers
-
Set the array elements whose value is 13 to 0
1377 Solvers
-
728 Solvers
-
739 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!