Closed prabaprakash closed 4 years ago
the above multiply functions operation needs optimization
solved by predefined bigint in js
function fibonacciModified(t1, t2, n) {
let hash = {};
hash[1] = BigInt(t1);
hash[2] = BigInt(t2);
for (let i = 3; i < n + 1; i++) {
hash[i] = (hash[i - 1] * hash[i - 1]) + hash[i - 2];
}
return hash[n]
}