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
Remove all the consonants
Back to basics 11 - Max Integer
Is this matrix orthogonal?
Swap two numbers
Connect Four Win Checker
Back and Forth Rows
Knight's Tour Checker
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