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.
public static BigInteger fibonacciModified(int t1, int t2, int n) {
// Write your code here
List results = new ArrayList<>();
results.add(BigInteger.valueOf(t1));
results.add(BigInteger.valueOf(t2));
BigInteger result = BigInteger.valueOf(0);
for( int i =2;i
}
return results.get(results.size()-1) ;
}
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 →
/ /\ /\ /\
public static BigInteger fibonacciModified(int t1, int t2, int n) { // Write your code here List results = new ArrayList<>(); results.add(BigInteger.valueOf(t1)); results.add(BigInteger.valueOf(t2)); BigInteger result = BigInteger.valueOf(0); for( int i =2;i