fn count_runs(indices: &[usize]) -> usize
Cuts the retained indices into maximal runs of consecutive positions.