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 one had me stumped for a day. Very rewarding once solved! Thanks!
Same!
This blew my mind!
I totally agree. This was much too easy for a 4 kyu.
I'm trying to wrap my head around this solution too. Could you briefly explain what is going on inside "if n != end + 1:" and how you came up with such an idea?
Cheers!
A generous helping of int() and // in python.
Good luck!
Thanks for your reply. I used integer conversions throughout my solution, but somehow the random tests would display a float occasionally, despite every output being defined as an integer. I'll have another look!
Cheers
One of the few 4 kyu that I just knew how to code up and found very straight forward, thanks! I found that the random tests behaved, well, randomly. Some would pass and some would fail depending on the numbers thrown to the function. These cases generally seemed to be where the seconds or minutes were 0.0000000001 away from the nearest int. I'll have another look, but everything passed fine and I was allowed to submit.
Built in functions make this very simple, took only a minute to code up. It boggles my mind that some 6kyu or 5kyu leave me stumped but this was easy-peasy. Thanks anyway!
My mistake, my eyes must be going! I was just confused by the change in notation from (x(m) **2 + x(m+1) **2)
The python examples in the description are incorrect as they are missing **2 for each. They should be:
Examples:
solve([2, 1, 3, 4]) returns [2, 11] :
(2 **2 + 1 **2) * (3 **2 + 4 **2) = 5 * 25 = 125 and 2 * 2 + 11 * 11 = 125
solve([2, 1, 3, 4, 2, 2, 1, 5, 2, 3, 4, 5]) returns [2344, 2892] :
(2 **2 + 1 **2) * (3 **2 + 4 **2) * (2 **2 + 2 **2) * (1 **2 + 5 **2) * (2 **2 + 3 **2) * (4 **2 + 5 **2) = 13858000
and 2344 * 2344 + 2892 * 2892 = 13858000
Flipping 'Gollum', just when I thought I passed, it made me rethink it all!
Thanks for the Kata!
This comment is hidden because it contains spoiler information about the solution
Short and sweet. Cheers!
hanksTay orfay hetay ataKay !
Loading more items...