Function onejoker::utils::oj_binomial

source ·
pub const fn oj_binomial(n: i32, k: i32) -> u64
Expand description

wiki | Calculate binomial coefficient Calculate the binomial coefficient “n choose k” using a lookup table. Is only valid for n, k in the range 0..=63.

use onejoker::prelude::*;
use onejoker::utils::oj_binomial;

assert_eq!(oj_binomial(5, 2), 10);