#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

#1793 in Data structures

Download history 49/week @ 2024-11-16 73/week @ 2024-11-23 78/week @ 2024-11-30 129/week @ 2024-12-07 123/week @ 2024-12-14 24/week @ 2024-12-21 8/week @ 2024-12-28 68/week @ 2025-01-04 128/week @ 2025-01-11 95/week @ 2025-01-18 60/week @ 2025-01-25 103/week @ 2025-02-01 128/week @ 2025-02-08 76/week @ 2025-02-15 101/week @ 2025-02-22 68/week @ 2025-03-01

396 downloads per month
Used in 4 crates (3 directly)

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