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
It's wrong. Because result is float value. :)
Try this with sq = 10000000000000000000000000000000001 (not a square).
This comment is hidden because it contains spoiler information about the solution
Math.sqrt() will give us decimals that aren't equal to zero if the number in its parameter is not a perfect square. So, when it goes through the ternary statement below it, it will go to the false section immediately and return -1.
Also, adding one is only going to help us if 'sq' is a perfect square, otherwise, it's not going to change anything (i.e. if the number isn't a perfect square).
You kind of need to look at it upside down and disect it a little bit.
Hope this helps.
This comment is hidden because it contains spoiler information about the solution
Language?
It took me a second, but this is brilliant.
Clever girl
This comment is hidden because it contains spoiler information about the solution
I don't undertand how this works. Could someone please explain?
I addded some default tests.
It uses // instead of # for comments in the Ruby version
There needs to be some test provided by default for this Kata
There is a test where the test where an array of nulls is appearing, there is no test case for this. Have the author add in a use case for the array of nulls in order for the user to test in all cases.