• + 1 comment

    Can you post your recursive solution, please.

    • + 1 comment
      public static BigInteger fiboMod(BigInteger t1,BigInteger t2,int n){
              n = n-1;
              if(n == 1){
                  return t2;
              }
              return fiboMod(t2,t2.pow(2).add(t1),n);
          }
      • + 0 comments

        This is not DP. Its plain Recursion.