import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in) ;
int t = scan.nextInt() ;
double sum = 0 ;
while(t-- > 0){
int n = scan.nextInt() ;
sum += facto(n) ;
}
System.out.println(Math.round(sum) % 107) ;
}
public static double facto(int n){
if(n == 0)
return 1 ;
double smallAns = facto(n-1) ;
return n * smallAns ;
}
}
This is the code I have written to this problem.Out of 7 test cases only 1 test case is failing , Can you tell me where I have committed the mistake in this problem