Problem 66. Find the two-word state names
Solution Stats
Problem Comments
-
12 Comments
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
What do this problem mean ?
@Cody Team, does this need to be a Cody Challenge? It's a pretty rubbish problem
I would vote for removal from this list as well. There is even another one about US states... This is so infuriating and repetitive I almost resorted to echoing assert.
I too would vote for removal from this list.
I can understand strtrim but not that in the solution there must be exactly the same amount of (say) 7 spaces between two consecutive words.
Solution Comments
-
1 Comment
Terrible test suite. The test suite fails if you don't replace every removed entry with exactly one space.
-
1 Comment
The pass criteria should not be specific to the number of spaces that are left instead of the omitted state names. This beats the purpose of the exercise. There should either be no extra spaces left in the solutions, or it should not be specific to how the author of the challenge solved the problem.
-
1 Comment
I've never cared so much about America
-
1 Comment
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"
-
2 Comments
I am a new Matlab programmer and don't know much about regexp. Is it not good to use that?
@Apurbo, regexp is a great function for its intended application. Unfortunately, some Cody users have exploited that function, and a few others, to cheat—the comment in this solution is referring to that widespread problem.
-
1 Comment
did not give the list of states names
-
1 Comment
Something wrong in test 1
Problem Recent Solvers964
Suggested Problems
-
2007 Solvers
-
Magic is simple (for beginners)
5311 Solvers
-
410 Solvers
-
707 Solvers
-
542 Solvers
More from this Author95
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!