I believe this problem has the wrong assertion for part 2. The space rule seems to be to keep spaces between words unless it is something like North Dakota in which you delete the space between the two words. Missouri New Hampshire seems to be missing a space, as only 3 are present. With three entries to delete there should be four spaces Missourix1x2x3xNew (4 x's or spaces for 3 matches).
There's an error in the second test case. This is what's returned: "Error: Error: A MATLAB string constant is not terminated properly." I assume this is due to there being an accidental new-line character in the input string.
I've cleaned up the second test. There was a bad character in there somewhere, but it's working now and I've rescored all the answers.
I get the infamous "Remove inappropriate content" message when trying to submit a solution to this problem.
This is a bizarre one - test case is dependent on how many spaces are between the state names, which points to a specific solution having to be used rather than a solution that makes sense to the user.
Additionally, I have noticed a stange effect in 19a when I use "join". My solution has too few spaces between "Delaware" and "Hawaii", so I thought I'd just bung another one in there with "join". If I do:
s2 = cell2mat(join(s2," ")), % I get the same number of spaces
s2 = cell2mat(join(s2," ")) % I get too many spaces!
Driving me wild...
@Kiran Ramsaroop, instructions are to remove state names, not spaces. It may seem silly to want this, but it is accurate.
Thus only spaces that are part of a removed state name should be removed.
tough
Be careful of the 2-word states.
Converting to different formats boggles me
Pay attention to the third case!It includes two-word name and one-word name.
Can you help?
s2 = ' Vermont ';
Here the task is to extract the word but result contained extra spaces????
check your test case with my programme. It passes all test suite case in MATALB 2017b but not passing the test suite here.
Ah - two word states count, like North Dakota.
Remove any row in which a NaN appears
6867 Solvers
Remove all the words that end with "ain"
1305 Solvers
522 Solvers
Sum the numbers on the main diagonal
459 Solvers
341 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!