We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #62: Cubic permutations
Project Euler #62: Cubic permutations
Sort by
recency
|
7 Discussions
|
Please Login in order to post a comment
I don't understand why my code doesn't work?!
The problem says, 'exactly' k, but in your code you add every number that reachs k.
Omg it worked! I realized the mistake. Thank you so much!!!
Hint: Try to use hash/dictionary to store data, then you can save a lot of running time!
For example: {'01234566': [41063625, 56623104, 66430125]} within:
41063625 = 345^3; 56623104 = 384^3; 66430125 = 405^3
'01234566' is a sorted string that contains all digits
If you're failing tests 0, 3, 5 but passing all others it's probably because you included entries larger than n in your permutations. For example, {1, 2, 3} is k=3, but for n = 2, k for the list is only 1 as both 2 and 3 are larger or equals to n.
Hi, can anyone please give more testcases with max valus of N and K? I am failing test-cases from #5 to #9.
This should work:
please suggest improvements.....can only pass 0 and 1st cases
my logic is almost same as yours and i am able to pass first 3 test cases only. can anyone give a hint.
There may be more solutions.
Don't use break since there can be many sets having permutation k