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.
how do people come up with these algorithms???
I completed the kata myself but this solution is greek to me. Guess I have a lot to learn
from a golfing perspective idk why you wouldn't just do n * n for squares, saves a whole 2 characters.
n < 0 && !(n % 2) ? -fn(Math.abs(n))[0] : fn(Math.abs(n))[0]
can be simplified to
n < 0 && !(n % 2) ? -fn(-n)[0] : fn(Math.abs(n))[0]
I would love for someone to walk through this
I fixed this solution here: https://www.codewars.com/kata/reviews/52a78825cdfc2cfc87000008/groups/620b7948793105000108b662
True, nice catch! Basically this happens because this solution does not calculate well the (-3 - 2), it returns -1 instead of -5. It would be nice to add this test to the solution validation.
This solution returns incorrect result for expression:
(2 - 2.5) - (-3 - 2) * (-5)
Returns -5.5, but should be -25.5
What lvl of algs is needed to get this?)
We have to. You can't mix
Number
andBigInt
, so if your base isBigInt
, your exponent has to be also. ( It's not so exponents can be ridiculously big. :P )Right shift (>>)
what does >> do?
This comment is hidden because it contains spoiler information about the solution
.
Why people raise the same issue over and over and over? Maybe because the author didn't fix the issue on time.
Loading more items...