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.
static String fibonacciModified(int t1, int t2, int n) {
BigInteger c=new BigInteger("0");
BigInteger a=new BigInteger(t1+"");
BigInteger b=new BigInteger(t2+"");
for (int i=0;i
{
c=a.add(b.multiply(b));
a=b;
b=c;
}
return c.toString();
}**
I hope this will help you
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 →