@@ -0,0 +1,1001 @@
+/*%0Ahttps://www.hackerrank.com/challenges/fibonacci-modified%0AAuthor: Vaibhav Sahu%0A%0A*/%0A%0Aimport java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A    static BigInteger fib(int n)%0A    %7B%0A%0A        BigInteger%5B%5D series = new BigInteger%5Bn%5D;%0A        series%5B0%5D=BigInteger.ZERO;%0A        series%5B1%5D=BigInteger.ONE;%0A        int i = 0;%0A        for (i = 2; i %3C n; i++)%0A        %7B%0A            series%5Bi%5D = series%5Bi-2%5D.add(series%5Bi-1%5D.multiply(series%5Bi-1%5D));%0A        %7D%0A%0A        return series%5Bn-1%5D;%0A    %7D%0A    public static void main(String%5B%5D args) %7B%0A        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */%0A        Scanner sc = new Scanner(System.in);%0A    int%5B%5D integers = new int%5B3%5D;%0A    for(int i = 0; i %3C 3; i++)%0A    %7B%0A        integers%5Bi%5D = sc.nextInt();%0A    %7D%0A        int termToBeFound = integers%5B2%5D;%0A        %0A        System.out.println(fib(termToBeFound));%0A        %0A        %0A    %7D%0A%7D%0A

Create Fibonacci.java