pub fn consolidate_slice<T: Ord, R: Semigroup>(slice: &mut [(T, R)]) -> usize
Sorts and consolidates a slice, returning the valid prefix length.