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
-
2183 Solvers
-
3410 Solvers
-
Remove the small words from a list of words.
1538 Solvers
-
4433 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3424 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!