fn check_molid_sorted(molecule_ids: &[usize]) -> bool {
    let mut previous = 0;
    for &i in molecule_ids {
        if i == previous || i == previous + 1 {
            previous = i;
        } else {
            return false;
        }
    }
    return true;
}
/// Check that `molecule_ids` is sorted and only contains successive values
Check that `molecule_ids` is sorted and only contains successive values
Check that ` molecule_ids ` is sorted and only contains successive values
fn check_molid_sorted(molecule_ids: &[usize]) -> bool {
    let mut previous = 0;
    for &i in molecule_ids {
        if i == previous || i == previous + 1 {
            previous = i;
        } else {
            return false;
        }
    }
    return true;
}
fn check_molid_sorted ( molecule_ids : & [ usize ] ) -> bool { let mut previous = 0 ; for & i in molecule_ids { if i == previous || i == previous + 1 { previous = i ; } else { return false ; } } return true ; }
Check that `molecule_ids` is sorted and only contains successive values
Check that ` molecule_ids ` is sorted and only contains successive values
molecule_ids
&[usize]