#give #vec #combination #values

combinations

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

1 unstable release

0.1.0 Aug 1, 2019

#1466 in Data structures

Download history 90/week @ 2024-07-28 72/week @ 2024-08-04 97/week @ 2024-08-11 74/week @ 2024-08-18 109/week @ 2024-08-25 123/week @ 2024-09-01 71/week @ 2024-09-08 92/week @ 2024-09-15 114/week @ 2024-09-22 111/week @ 2024-09-29 45/week @ 2024-10-06 82/week @ 2024-10-13 55/week @ 2024-10-20 68/week @ 2024-10-27 73/week @ 2024-11-03 25/week @ 2024-11-10

224 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