fn create_permutations() -> Vec<[u32; 4]> {
    let mut permutations = Vec::with_capacity(156_849); // 99! / (3! * 96!)
    let n: u32 = 100;

    for a in 0..n + 1 {
        for b in a..n + 1 {
            for c in b..n + 1 {
                permutations.push([a, b - a, c - b, n - c]);
            }
        }
    }

    permutations
}
/// Uses the "stars and bars" methodology to find the all combinations of 4 positive
/// integers that add up to 100
Uses the "stars and bars" methodology to find the all combinations of 4 positive
integers that add up to 100
Uses the " stars and bars " methodology to find the all combinations of 4 positive integers that add up to 100
fn create_permutations() -> Vec<[u32; 4]> {
    let mut permutations = Vec::with_capacity(156_849); // 99! / (3! * 96!)
    let n: u32 = 100;
    for a in 0..n + 1 {
        for b in a..n + 1 {
            for c in b..n + 1 {
                permutations.push([a, b - a, c - b, n - c]);
            }
        }
    }
    permutations
}
fn create_permutations ( ) -> Vec < [ u32 ; 4 ] > { let mut permutations = Vec :: with_capacity ( 156_849 ) ; // 99! / (3! * 96!) let n : u32 = 100 ; for a in 0 .. n + 1 { for b in a .. n + 1 { for c in b .. n + 1 { permutations . push ( [ a , b - a , c - b , n - c ] ) ; } } } permutations }
Uses the "stars and bars" methodology to find the all combinations of 4 positive
integers that add up to 100
Uses the " stars and bars " methodology to find the all combinations of 4 positive integers that add up to 100