Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Please add assertion messages showing the inputs on failure.
This is the most gas efficient solution.
Change has already been applied in solution setup (maybe author did it) so I'll reject this.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The
__add__
function is called when adding to values:2 + 5
or"Hello" + "World"
.Here the function isn't called but bound to the
'Hello, '
String and then the function is assigned to hello. The test code then calls this function with the name.Actually this can't be the case. If the sample rate would be 3 bit per character there is no way to have 7 '0' in a row. With 3 bit per character there can only be '0' strings of length 3 (between dots and dashes), 33=9 (between characters) and 37=21 (between words).
Because of this the bits per character must be 1, as this is the only way we can get '111' and '0000000' at the same time
Yes there need to be at least one zero between each dot and dash, but with '1110000000111' we only have 2 dashes, each building a word of 1 character.
'1110000000111' -> '- -' -> 'T T'
We would need to have '111000111' in order to get '..' -> 'I'
'111000000000111' would lead to '. .' -> 'E E'
I think it would be more efficient to decode morse and replace afterwards as this reduces the amount of Characters the replace function is working on.