I have a single list of items, as below. How would I iterate through this list recursively to group by the start and end items?
This is essentially inner rings of a p