Find date ranges matching boolean criteria map
Filed under Nearbuy
The question
Given a list of dates and a map of weekdays to boolean values, find all contiguous ranges of dates that evaluate to true with a single O(n) traversal.
No write-up yet. Related questions below have one.
Related Nearbuy questions
Collected from public candidate posts and coding forums. Updated Nov 2026.