pub fn combination(n: usize, k: usize) -> usize
Expand description

Returns the number of k-combinations of a set of n elements.

See wikipedia for more information.

Examples

assert_eq!(combination(4, 0), 1);
assert_eq!(combination(4, 1), 4);
assert_eq!(combination(4, 2), 6);
assert_eq!(combination(4, 3), 4);
assert_eq!(combination(4, 4), 1);
assert_eq!(combination(4, 5), 0);