ranges_helper library

Functions

combineRanges<T>(List<(int, int, T)> ranges, {required T combine(T x, T y), required bool compare(T x, T y)}) List<(int, int, T)>
Combines ranges of values ​​by calling the combine function, comparing values ​​by calling the compare function.
normalizeRanges(List<(int, int)> ranges) List<(int, int)>
Normalizes ranges by sorting and merging them.
sortRanges(List<(int, int)> ranges) List<(int, int)>
Sorts ranges in ascending order.