Hacker News new | ask | show | jobs
by skip 5642 days ago
Oh, I missed this detail. In that case for a deterministic result I think you need to look at every possible combination. However, you can order them by the minimum criterion first, and start searching from the smallest to largest, so then the first group than meets the interval criteria is guaranteed optimal.