#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

#1606 in Data structures

Download history 83/week @ 2024-03-13 112/week @ 2024-03-20 108/week @ 2024-03-27 88/week @ 2024-04-03 74/week @ 2024-04-10 74/week @ 2024-04-17 85/week @ 2024-04-24 72/week @ 2024-05-01 71/week @ 2024-05-08 70/week @ 2024-05-15 87/week @ 2024-05-22 81/week @ 2024-05-29 72/week @ 2024-06-05 72/week @ 2024-06-12 73/week @ 2024-06-19 53/week @ 2024-06-26

284 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