Function onejoker::utils::oj_next_combination
source ยท pub fn oj_next_combination(a: &mut [usize], n: usize) -> bool
Expand description
wiki | Iterate over combinations Given an array of indices into a larger array, increment the 0-based indices to the next k-combination, returning true when done.
use onejoker::prelude::*;
use onejoker::utils::oj_next_combination;
let mut a = [0,1,2];
oj_next_combination(&mut a, 5); // 0,1,3
assert_eq!(a[2], 3);