Compute n choose k modulo 10^9+7 efficiently without overflow.
Constraints
Example
>>> binomial_coefficient(5, 2) 10 >>> binomial_coefficient(5, 0) 1 >>> binomial_coefficient(5, 5) 1 >>> binomial_coefficient(10, 3) 120 >>> binomial_coefficient(100000, 50000) 149033233
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints