Ad
  • Default 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

    Oh my god. It took me so long to realise what the description meant.
    I thought we were presuming that the time units for all of the dot / dash / sepeartions were uneven and you had to find their lengths given they should be in a size order (dot/dash is made of 1s but a dash will be longer), not that they will stick to the (k * "time unit"). That is so much easier...

  • Custom User Avatar

    If you really wanted to make sure you don't do more checks than you need to wouldn't you:
    Set count to 1 to count intelf.
    Go through from 1 to n/2. (Note that in the case of n = 1 the for loop just gets skipped.)
    Return count.

    Personally, don't really think that the more iterations matter, but if you are doing this then the if statement at the start feels awkward

  • Custom User Avatar

    I forgot you can use non integer powers...