Iterative Function to calculate ( nCr ) % p and save in f [ n ] [ r ] C ( n , r ) % p = [ C ( n - 1 , r - 1 ) % p + C ( n - 1 , r ) % p ] % p and C ( n , 0 ) = C ( n , n ) = 1
def nCr ( n , p , f ) : NEW_LINE INDENT for i in range ( n ) : NEW_LINE INDENT for j in range ( m + 1 ) : NEW_LINE DEDENT DEDENT