Sort 12 Discussions, By:
Please Login in order to post a comment
Exactly why is the symbol N used to describe two different parameters in the questions.
For example in the beginning we ae told the definition of N as a number whose factors are equal to their sum.
In the actual question the number N is actually number of factors [2<=k<=N].
I have seen this discrepency in many of the questions in hackerrank. Someone is not properly proof reading the questions.
Is there any non-recursive approach out there? The recursive version loops through candidates in such a way that answers are updated occasionally (an answer you find midway might be replaced by another at the end of the day).
I tried to use a dequeue and set to generate multiplicative partitions (based on a list of primitive factors) of ascending n, and whenever any answer is found it is guaranteed to be one of the final answers. It seems to be correct but was too slow for half of the test cases. I don't know if it is because of the algorithm itself which is poor in nature, or the extensive use and manipulation of list and set in this case.
This is the difference between constructing products from ascending factors and constructing factors from ascending products. Well, after all the former approach sounds a lot more straightforward.
40 test cases ?! Seems to be a new record for Project Euler challenges.
I would like to ask why the importation of 12 when the answer is 61.
I have a code but it doesnt work good for, large numbers.
Can somebody give me more sample inputs and outputs for debugging.