Catalan numbers

Will this work if one uses big factorial code??

@aiman.mumtaz
catlan numbers till 100, will fit inside the unsigned long long int, so i dont think you need to worry about the overflow. But i should mention that there is no association between factorials and catlan numbers. Recurance relationship between the catlan numbers is C[0]=1,C[n+1]=sum(C[i]*C[n-i]) for all 0<=i<=n and you would have to use DP to solve this question.

nth number is given by (2n!)/(n!)(n!) so can’t we calculate using that

If you wish to use this approach then you can’t really calculate the factorials but you can combinatorics to solve, since the nth catlan number is nth binomial coefficient we can simply calculate it using the following code: