Split a list of dates into subsets of consecutive dates
问题 I've got an array of dates that can contain multiple date ranges in it. dates = [ '2020-01-01', '2020-01-02', '2020-01-03', '2020-01-06', '2020-01-07', '2020-01-08' ] In this example, the list contains 2 separate consecutive date ranges (2020-01-01 to 2020-01-03 & 2020-01-06 to 2020-01-08) I'm attempting to figure out how I would loop through this list and find all the consecutive date ranges. One of the articles I'm looking at (How to detect if dates are consecutive in Python?) seems to have