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 =)
This comment is hidden because it contains spoiler information about the solution
Huh I guess I did it a different way than you then.
This comment is hidden because it contains spoiler information about the solution
.
The hard part of this for me was finding the solution to the math problem. Once you have it the code wasn't all that complex. Very fun Kata! To anyone struggling I would say to look into the math bits. I didn't find the supplied article all that helpful IMO.
Your code should only return a single pair.
When I call this function with 531441 then run the program with node inside of a terminal I get.
Are you returning only one pair?
I did this kata using JS.
My code doesn't time out most of the times when I try it now however I got this error message which is confusing to me because they are valid pairs.
If you try both of these pairs in a calculator they come out to 531441. I think therefore there must be something wrong with the tests on the site? If someone could give me some insight here I would appreciate it.
Yeah I am having same issue. I can get like 50 mill to go through but get this time out nonsence. My code looks pretty clean too.
This comment is hidden because it contains spoiler information about the solution
Why does nobody comment their code on here? I feel that defeats the whole purpose of reading over the code to learn new stuff. A comment like 45 is the sum of every number 1-9 would be helpful right off the bat. What confuses me is how does this compare all the possibilities of every Sudoku grid? What do sumh and sumv represent? It looks like osums represents 1 sudoku 9x9 grig but with no comments unless you throw the code into an editor and play around with it who knows?
Loading more items...