You are viewing a single comment's thread. Return to all comments →
for(n=0; n<=2000; n++) { for(r=0; r<=n; r++) { if(r==0 || r==n) com[n][r]=1; else com[n][r]=(com[n-1][r-1]+com[n-1][r])%1000000007; } }
i am not getting why this two loops are being used sir will you please make me understnad with example?
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Permutations
You are viewing a single comment's thread. Return to all comments →
for(n=0; n<=2000; n++) { for(r=0; r<=n; r++) { if(r==0 || r==n) com[n][r]=1; else com[n][r]=(com[n-1][r-1]+com[n-1][r])%1000000007; } }