#vec #combination #values #give

combinations

This crate give you all the combinations of values in a vec

1 unstable release

0.1.0 Aug 1, 2019

#1097 in Data structures

Download history 46/week @ 2023-12-04 62/week @ 2023-12-11 61/week @ 2023-12-18 27/week @ 2023-12-25 18/week @ 2024-01-01 42/week @ 2024-01-08 47/week @ 2024-01-15 35/week @ 2024-01-22 27/week @ 2024-01-29 30/week @ 2024-02-05 50/week @ 2024-02-12 72/week @ 2024-02-19 90/week @ 2024-02-26 68/week @ 2024-03-04 82/week @ 2024-03-11 106/week @ 2024-03-18

351 downloads per month
Used in 3 crates

MIT/Apache

8KB
119 lines

Project Title

This crate give you all the combinations of values in a vec

Example

let actual: Vec<_> = Combinations::new(vec![1, 2, 2, 3, 4], 3).collect();
let expected = vec![
    vec![1, 2, 2],
    vec![1, 2, 3],
    vec![1, 2, 4],
    vec![1, 3, 4],
    vec![2, 2, 3],
    vec![2, 2, 4],
    vec![2, 3, 4],
];
assert!(actual == expected);

Contributing

Any contributions are welcomed.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.


lib.rs:

This crate give you all the combinations of values in a vec

No runtime deps