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.
What exactly does the i+ do? I'm not quite getting it..
I think I have the most concise answer to this kata! Please vote up my solution if you agree :)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I wanted to do this but for whatever reason I got it in my head that importing libraries wasn't allowed. I guess I've been doing too many foobar challenges.
Beautifully clear.
Guido hates the return type being dependent on argument values. That's why even 8/2 is 4.0 in sane Pythons, not 4. Although, of course, there is an exception. Can you tell what it is? :-]
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Man, I forgot about using and to avoid an if...else :\
This comment is hidden because it contains spoiler information about the solution
*Edit*: Sorry, completely misinterpreted your comment. I've added an issue to the kata and will add the
0
test as soon as #163 gets fixed.Given the definition of perfect square in this Kata this solution is actually not correct. You should have n >= 0 because 0 is a perfect square in this problem! :)
-2 * -3 - 1 = -7
0 > -7, max(-7,0) = 0