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.
0.09 is a random value to estimate the maximum range to check upon, i.e, no mathematical reasoning behind it.
Also, your code would check all number of
(2^53-1) * 0.09
which is equivalent to8.10647932927E+14
down to 0 and doing exponentation on such Big Integers would inevitably cause overflow, if not execution time out.You should find a mathematical threshold to stop looping (early exit) or just research on some properties of perfect powers. ^^
yeah, that's a good point.
I've started to comment my code and even leave in console.logs.
The reason I left them out was to get the code as succinct as possible, but that's just for pride.
You have to run all tests in 12s not only one =)
Your code takes up to 3 seconds for a single test, there are hundreds of tests here.
This comment is hidden because it contains spoiler information about the solution
.
Your code should only return a single pair.
Are you returning only one pair?
Your
isPresent
value isfalse
for the first sample test. And so your function returnsfalse
.Please see here gow to format code properly: https://docs.codewars.com/references/markdown/#code-block
Please read through this article on how to debug your solution and where to get some help: https://docs.codewars.com/training/troubleshooting . The article is a bit long, but some paragraphs should give you some hints how to find errors in your code and where to get help.