My issue
What is wrong here
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t>0){
int a,b,n;
a = sc.nextInt();
b = sc.nextInt();
n = sc.nextInt();
System.out.println(fibo(a,b,n));
t--;
}
}
static Map<Integer,Integer> m = new HashMap<>();
static int fibo(int a,int b,int n){
if(n == 0) return a;
if(n == 1) return b;
if(!m.containsKey(n)){
int l = fibo(a,b,n-1);
m.put(n,l);
} else{
return m.get(n);
}
return fibo(a,b,n-1)^fibo(a,b,n-2);
}
}
Problem Link: Special Fibonacci Practice Coding Problem