Given a list of states, remove all the states that have two-word names.
s1 = 'Alabama Montana North Carolina Vermont Nevada';
s2 = 'Alabama Montana Vermont Nevada';
The test function has some incorrect values: Nebraska and Nevada are incorrectly removed, Rhode Island, South Carolina, South Dakota and West Virginia are incorrectly left in.
I've fixed the problem and you're now the leader. Sorry about that!
A second test case is needed for this problem. 'New York Nevada' should suffice.
I added another test, similar to the one suggested. Thanks for the comment Richard!
I keep getting 'inappropriate content' errors.
"Remove inappropriate content" error...
What is " two_word name"??
if i would grasp all regexp possibilities in depth.. makes me cry
Inconsistent behavior - if you are going to make a question like this, make it representative of what would actual be done and not some arbitrary undocumented rules like "replace a two-word state name with a space"
did not give the list of states names
Something wrong in test 1
Find the two most distant points
Project Euler: Problem 9, Pythagorean numbers
Back to basics 17 - white space
Make an awesome ramp for a tiny motorcycle stuntman
Make the vector [1 2 3 4 5 6 7 8 9 10]
Read a column of numbers and interpolate missing data
Clean the List of Names
Remove the vowels
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office