Run error help me out
N has a worst case value of 100000000 . Your code is traversing N thats why it is showing error. Factorial of N is creating lots of stacks due to recursive calls . Try to change your logic .
what can i do now i have 2 more option for calculating factorial simple loop till n or matrix exponentiation
still one test case is not passed it says wrong ans