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...
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
Which doors are open?
find the maximum element of the matrix
Renaming a field in a structure array
DNA N-Gram Distribution
Remove the polynomials that have positive real elements of their roots.
Find the peak 3n+1 sequence value
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