#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

#1282 in Data structures

Download history 67/week @ 2024-03-02 85/week @ 2024-03-09 103/week @ 2024-03-16 92/week @ 2024-03-23 114/week @ 2024-03-30 72/week @ 2024-04-06 84/week @ 2024-04-13 80/week @ 2024-04-20 78/week @ 2024-04-27 66/week @ 2024-05-04 73/week @ 2024-05-11 83/week @ 2024-05-18 79/week @ 2024-05-25 86/week @ 2024-06-01 41/week @ 2024-06-08 92/week @ 2024-06-15

311 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