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.
.
The final test does, but randomized. Maybe you were so lucky that not a single test out of 200 test cases generated a number.
The Dart Translationr didn't appear in the kata
Ranks can't be changed though.
I'm sure most people here are better educated in mathematics than I, but I at least do know it's all math here. If there is pure math or unpure math, okay, I don't know. The point of this was: not to use functions. That having been said, I would like to know why MasterZeNoX considers his code "purer". Thanks all :)
@rowcased It's all math, though...
floor
andlog10
is just math, not JS. What's not pure math about it?what pure? looks like you used a couple methods there...
A "purer" maths approach would be
Math.floor(Math.log10(x)) + 1
But I have reservations about initing two related variables separately. Define
y = 10**(n-1)
. Also,x = 0 => n = -323
?!?Codewars has some stuff before your solution, so the line numbers are inaccurate. Also, not an issue.
Please post your code with a spoiler flag so we can help.