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.
There are, but they are not provided for us in hackerrank. I found the same thing as others who attempted to solve the problem with C++; that the task becomes more about how to implement a big integer class instead of solving a very simple dynamic programming problem. That being said, it was a very good exercise. Unfortunately, my solution is not yet optimized enough to perform well enough after about 18 or so iterations.
Just for the heck of it, I wrote up a solution in Java. 5 minutes and 41 lines later a solution that passes all of the test cases by using the BigInteger class which is a part of the JDK.
I think those that solve the problem in C/C++ (or any other language that does not include a big integer implementation) should get extra credit for a complete solution.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci Modified
You are viewing a single comment's thread. Return to all comments →
There are, but they are not provided for us in hackerrank. I found the same thing as others who attempted to solve the problem with C++; that the task becomes more about how to implement a big integer class instead of solving a very simple dynamic programming problem. That being said, it was a very good exercise. Unfortunately, my solution is not yet optimized enough to perform well enough after about 18 or so iterations.
Just for the heck of it, I wrote up a solution in Java. 5 minutes and 41 lines later a solution that passes all of the test cases by using the BigInteger class which is a part of the JDK.
I think those that solve the problem in C/C++ (or any other language that does not include a big integer implementation) should get extra credit for a complete solution.