Given two nonnegative integers n,k
such that 0 <= k <= n
, return the binomial coefficient
c(n,k) := (n!) / (k! * (n-k)!)
Test cases
Most languages will probably have a built in function.
c(n,0) = c(n,n) = 1 for all n
c(n,1) = c(n,n-1) = n for all n
c(5,3) = 10
c(13,5) = 1287
Related challenges
Catalan Numbers Compute the multinomial coefficient Generate Pascal's triangle m-nomial coefficient