Your challenge is to create a function that takes an *unsorted* (-i.e. not in ascending or distending order) list of integers and returns a list of lists of ascending ranges.
NOTE:
- This task can be done without "sorting" the initial list. -i.e. there is no need to use "sort '<" to complete this task.
(range-lists '(22 4 15 3 14 1 9 16 2 21 23))
> ((1 4) (9) (14 16) (21 23))
Explanation:
(22 4 15 3 14 1 9 16 2 21 23) ; [initial] input
=> ((1 2 3 4) (9) (14 15 16) (21 22 23)) ; [intermediate] list of lists of int ranges
=> ((1 4) (9) (14 16) (21 23)) ; [final] output
(range-lists '(1 3 2 6 0 8 -1 7 10 12 14 15 30 18 19 21 23 22 4 -5 31 32 33 40 35 39 42 43 44 45))
> ((-5) (-1 4) (6

(10) (12) (14 15) (18 19) (21 23) (30 33) (35) (39 40) (42 45))
NOTE:
- Reversing the list back from final output to intermediate phase should be an easy task.