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.
Very nice kata, but I felt the same about the optimisation - I've completed it in Python as well btw. The description should make the optimisation demands clear, otherwise I've spent hours with my fully working (logic wise) code that would not be accepted by the server. Ended up mindlesly copying prime algorithms from different sites just to see if they improve the speed.
Kata solved now, but all the good feeling about getting the logic is lost after all the obscure and undefined loops on making it pass the server 12sec limit. Nothing wrong with optimisation katas, but please, make it clear in the description. Had to rate it a "sad face" purely because of that, very nice kata otherwise.
Maybe author could relax some of his tests, as big numbers do little to test the logic anyway.
This comment is hidden because it contains spoiler information about the solution
Passed in Python 2.7, but ONLY after doing a lot of adhoc nonsense changes to dance around incosistent rounding rules.
eg:
if abs( round(seconds_exact,0) - round(seconds_exact,9) ) <0.001:
seconds = round(seconds_exact,0)
else:
seconds = int( seconds_exact )
The description says "...don't worry for fractions of second..." - haha, it was the biggest worry by a mile. Needs specifics on how rounding off is to be done.