Skip to main content

compact_ranges

Function compact_ranges 

Source
pub fn compact_ranges(numbers: &[i32]) -> String
Expand description

[20, 21, 22, 25] as 20-22,25. The input need not be sorted and may repeat.