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.
fiel copia de la de arriba jajajajajaj
There might be an equation somewhere that you can use to calculate the distance between two points
Not quite sure where to start with this one.
Not a kata issue, closing - and please double-check your issues before you raise them :)
In javascript the float "1.0" will be printed as just 1, the last test case never will be achieved
39 => 3.9
9 => 0.9
10 => 1 XXXX
I can't figure out how the distance is being calculated :C Any tips=
Thank you so much for your explanation and the function explaining it. I tested it and it worked with my assumptions in the way your functions explained. I shall look more into bitwise operations as well.
This comment is hidden because it contains spoiler information about the solution
Now I can read it: does nobody notice the medium random tests in JS have a zero more than in Python? Josh even said so!
Not that it matters though.
Node 8.x
consistently fails my solution, even with1e5
;Node 14.x
consistently passes my solution, even with1e6
.For my naive solution, this immediately let me pass ..
I know. I don't know if they did that before or after the JS translation, and which language version they ranked.
i do not think it significantly improved performance either. i tried the solution from the top message above who reports a time out and it is still too slow. but it uses
Array.splice()
which i reckon is rather expensive because it must shift the array indices to the right ofidx
This comment is hidden because it contains spoiler information about the solution
the Node version is
8.x
perhaps14.x
would be faster ? i just enabled it, if you want to tryIf it's
7kyu
, IMO more or less any naive solution should pass, in any language.There is not even a good reason for tests with millions of numbers, or numbers of millions. What does that add, to a
7kyu
kata ?!?Yes, I think this issue is an
Issue
.I've just tried to implement my original Python's solution in JS, and it times out. JS is usually much faster than Python, maybe Python list slicing implementation allows a fast execution here. That's beyond me. I don't know what should be done, but it appears that numbers ranges do match between languages and they are not the culprit. I'm not convinced this should be considered an issue, it's hard to find an exact equality between languages (very often Python slowness makes things harder in this language); not all naive solutions fail in JS.
Loading more items...