Problem 1696. Morse Code Generator! Try it!
Solution Stats
Problem Comments
-
2 Comments
please either fix it or remove it from the Strings II badge list
The test suite should be working now. I fixed the parentheses problem mentioned in the other comments (it should now recognize left and right parentheses as different). There were also seven spaces between words in the test suite, though the encoded description indicated five—that has been fixed, as well.
Solution Comments
-
3 Comments
I think this test suite is broken, Even if I return a copy of y_correct the assertion fails. Also the answer for test 2 is incorrect, the '(' is wrong both parens are the code for ')'. running the test code in my matlab the assertions do not fail.
You are correct that the test suite is messed up. I just submitted one with the correct Morse Code string for '(' [which failed], and one with the incorrect substitution [which passed].
Andrew Dobrovolc was right, the "(" is confused with ")".
Problem Recent Solvers52
Suggested Problems
-
6414 Solvers
-
Find the peak 3n+1 sequence value
1556 Solvers
-
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
382 Solvers
-
Natural numbers in string form
761 Solvers
-
749 Solvers
More from this Author17
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!