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.
Fibonacci Modified
Fibonacci Modified
Sort by
recency
|
714 Discussions
|
Please Login in order to post a comment
Can anyone shed light on how to complete this problem in Cpp. The problem requires the function to return int while the ouput can exceed the bound of a 32-bit integer? Does this not make it fundamentally impossible to correctly implement a Cpp solution? Am I dumb (yes but thats beside the point)...?
this is my code in python, it exceeded the time with Python3 but passed with PyPy3
the number is too big
My solution Js, using memoization and closures.
this problem can't be solved in c# unless you modify the return type, int can't handle the upper bound, so changed to string, used BigInteger internally and then it worked, this should be fixed in order to actually solve the problem, as it state "The function is expected to return an INTEGER." that is not valid