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
I would suggest having a test case where the numeric value is zero, to cover the edge case.
This solution fails for numeric values of 0. The ternary operator should have this>=0 or have this<0 and the last two arguments swapped.
The description does not mean to take the integer portion, it means the absolute value (i.e. if it's negative, treat it like it is positive). The absolute value of -257.8333333333333 is 257.8333333333333, not 257.
There are a lot of strange criteria that seem to be tacked on to the problem and seem to not really add much, and just point the coder to a specific set of solutions, rather than making it more challenging or thought provoking.
I would suggest having a perfect square number as one of the test cases during final submission, because I was able to create a solution that passed all of the cases, but fails for primes (it duplicates the square root in the output)