pub fn is_sorted<T>(sequence: impl IntoIterator<Item = T>) -> boolwhere T: Borrow<usize>,
Checks whether the given index sequence is monotonically non-decreasing.