Problem 66. Find the two-word state names
Solution Stats
Problem Comments
-
13 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.
Terrible test cases. Terrible. Lazy and slumpy test cases. Needed to reverse engineer to get the problem done. Test cases need to be adjusted.
Solution Comments
-
1 Comment
I just hate this kind of stupid problem, just because it's game doesn't mean that the two-worded names are stored in the same sense as other names. Just annoying. And Also I got to improvise the solution a lot
-
1 Comment
This solution was marked as potential spam and was not posted???
never seen before
-
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 Solvers1059
Suggested Problems
-
14131 Solvers
-
What is the next step in Conway's Life?
1105 Solvers
-
945 Solvers
-
Find the maximum number of decimal places in a set of numbers
2008 Solvers
-
463 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!