I am getting an error of Time Limit Exceeded in the following Code.
Pls help me.
class Solution {
public int tribonacci(int n) {
if (n == 0){
return 0;
}
else if (n == 1 || n == 2){
return 1;
}
return tribonacci(n-1) + tribonacci(n-2) + tribonacci(n-3);
}
}