Sort by

recency

|

720 Discussions

|

  • + 0 comments

    Looking for an epic desert experience? Check it out at Dune Buggy Dubai and discover the adventure of a lifetime! Check it out the exciting buggy rides that are safe, fun, and perfect for all adventure seekers.

  • + 0 comments

    //Java public static BigInteger fibonacciModified(int t1, int t2, int n) { BigInteger[] dp = new BigInteger[n+1]; dp[0] = BigInteger.valueOf(t1); dp[1] = BigInteger.valueOf(t2);; for (int i = 2; i < n; i++) { dp[i] = dp[i - 2].add(dp[i - 1].multiply(dp[i - 1])); }

    return dp[n-1];
    

    }

  • + 0 comments
    def fibonacciModified(t1, t2, n):
        sys.set_int_max_str_digits(10**6) 
        for _ in range(1, n):
            t1, t2 = t2, t1 + pow(t2, 2)
        return t1
    
  • + 0 comments
    import sys
    sys.set_int_max_str_digits(10000000)
    
    def fibonacciModified(t1, t2, n):
        for _ in range(n - 2):
            t3 = t1+t2**2
            t1 = t2
            t2 = t3
        return t3
    
  • + 0 comments
    def fibonacciModified(t1, t2, n):
        if n==1:
            return t1;
        elif n==2:
            return t2;
        else:
            nt1 = fibonacciModified(t1, t2, n-2)
            nt2 = fibonacciModified(t1, t2, n-1)
            return nt1 + nt2*nt2;
    

    yeah memoization would be helpful