This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 'Morse code is FUN!';
y_correct = '-- --- .-. ... . -.-. --- -.. . .. ... ..-. ..- -. -.-.--';
assert(isequal(MorseCodeGenerator(x),y_correct))
ystr =
'-- --- .-. ... . -.-. --- -.. . .. ... ..-. ..- -. -.-.--'
y_correct =
'.- -- .. ..--- ----- --..-- -.--.- .-- .... --- -.- -. --- .-- ... ..--.. -.--.-'
|
2 | Fail |
x = 'Am I 20, (who knows?)';
y_correct = '.- -- .. ..--- ----- --..-- -.--.- .-- .... --- -.- -. --- .-- ... ..--.. -.--.-';
assert(isequal(MorseCodeGenerator(x),y_correct))
ystr =
'.- -- .. ..--- ----- --..-- -.--.- .-- .... --- -.- -. --- .-- ... ..--.. -.--.-'
y_correct =
'.- -- .. ..--- ----- --..-- -.--.- .-- .... --- -.- -. --- .-- ... ..--.. -.--.-'
|
3 | Pass |
x = 'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG: or does he...';
y_correct = '- .... . --.- ..- .. -.-. -.- -... .-. --- .-- -. ..-. --- -..- .--- ..- -- .--. ... --- ...- . .-. - .... . .-.. .- --.. -.-- -.. --- --. ---... --- .-. -.. --- . ... .... . .-.-.- .-.-.- .-.-.-';
assert(isequal(MorseCodeGenerator(x),y_correct))
ystr =
'- .... . --.- ..- .. -.-. -.- -... .-. --- .-- -. ..-. --- -..- .--- ..- -- .--. ... --- ...- . .-. - .... . .-.. .- --.. -.-- -.. --- --. : --- .-. -.. --- . ... .... . ...'
y_correct =
'.- -- .. ..--- ----- --..-- -.--.- .-- .... --- -.- -. --- .-- ... ..--.. -.--.-'
|
4 | Pass |
x = '1234567890';
y_correct = '.---- ..--- ...-- ....- ..... -.... --... ---.. ----. -----';
assert(isequal(MorseCodeGenerator(x),y_correct))
ystr =
'.---- ..--- ...-- ....- ..... -.... --... ---.. ----. -----'
y_correct =
'.- -- .. ..--- ----- --..-- -.--.- .-- .... --- -.- -. --- .-- ... ..--.. -.--.-'
|
Find all elements less than 0 or greater than 10 and replace them with NaN
11631 Solvers
202 Solvers
Similar Triangles - find the height of the tree
156 Solvers
631 Solvers
285 Solvers