I am gettig segmentation fault , can you please check my code


can you please check my code .

@aditya12679 you are getting TLE not segmentation fault,because you have used very eneffcient method for calculating combinations.

should i use big integer for this ?

No, you need to implement an effcient method so that you won’t need to calculate factorials repetitively

is there any other method than n*fac(n-1) ?

https://ide.codingblocks.com/s/337669 i have changed it to this

Look at this for help and try to make your code like this.https://ide.codingblocks.com/s/323955