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 Solvers1187
Suggested Problems
-
Back to basics 8 - Matrix Diagonals
941 Solvers
-
Back to basics 21 - Matrix replicating
1706 Solvers
-
1945 Solvers
-
804 Solvers
-
Height of a right-angled triangle
1903 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!