Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar

    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'

  • Custom User Avatar

    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.