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
-
299 Solvers
-
10362 Solvers
-
477 Solvers
-
Return the first and last characters of a character array
10443 Solvers
-
Find the Oldest Person in a Room
18293 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!