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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
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...
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
I forgot you can use non integer powers...