Using nCr property of pascal's triangle


#1

I have used the nCr formulae to solve this in O(n).
the formulae is …nCr=nCr-1*((n-r+1)/r)


#2

I tried using nCr formula but my code showed memory full and a segmentation fault occurred.
Please help.