this code is giving WA for second constraints and WA from rest.
That’s not a link to your code
1 Like
For division in modular arithmetic you need to compute Modular Inverse and multiply with it:
Bold is the line with error:
for(int i=0;i<k;i++)
{
res*=(n-i);
**res/=(1+i);**
res%=1000000007;
}
return res%1000000007;
1 Like
Can u explain me how to solve it??