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.
While I wouldn't do the check using root of n but instead the square of the running index since that is faster, he is generally right to just check until the squareroot since every divisor you find already has another factor on the other side of the root you need to multiply with to get n. Think of this as an area of same sice but different side length were you shorten one side so the other get's longer. When you arrive at the perfect square, you don't have to go further since all other sidelengths were already checked "the other way round" (hence add 2 to the output for every divisor except for the root - there the other factor is identical).
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
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You are ${n-m} ${year} old.
would be betterwhy is that?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
That's a clever way of concatenating strings
Why
-n+m
instead ofm-n
?Not so beautiful but, anyway...
Codewars could have a button for bad solutions
Why people are voting "Best Practice" to a String concat loop?
Loading more items...