algorithmz 1.0.9

This is the corresponding implemenation of the python module of the same name.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use algorithmz::array::move_zeros;

#[test]
fn test_move_zeros_empty() {
    let result = move_zeros(&[]);
    assert!(matches!(result, Err(ref e) if e == "Cannot move zeros in an empty list!"));
}

#[test]
fn test_move_zeros() {
    let result = move_zeros(&[0,1,0,2,0,3,0,4,0,5]).unwrap();
    assert_eq!(result, vec![1,2,3,4,5,0,0,0,0,0]);
}