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"??
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
Extract leading non-zero digit
Counting in Finnish
Reverse the Words (not letters) of a String
Getting the absolute index from a matrix
Test if two numbers have the same digits
Select every other element of a vector
Find the sum of all the numbers of the input vector
Make a checkerboard matrix
Sums with Excluded Digits
Which doors are open?
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