I have the following table, with two rows. The first value in each row is the "minimum difference" between terms. The rest is a series of numbers at least that far apart from each other, but could be more, for example the first few numbers in row one can also be like so: 60 | 0 60 140 210 270 ....
60 | 0 60 120 180 240 300 360 420 480 540 60090 | 0 90 180 270 360 450 540 630 720 810 900What my goal here is that given a few external values, offset, time and duration. I would like to check if that time falls within a specified window.
So for example:
If the offset is 4, and the duration is 15. Then I would like to check if the time falls in any of the following ranges (for example row 1):
4 - 15, 64 - 79, 124 - 139.
However one small issue I am having is I don't know how to do the next part, which is if the values are separated by a time of minimum difference + offset or more, then we just start at the given time. And discount any offset usage after that fact. So for example:
60 | 0 60 140 200 280 ....
Then the windows would be:
4 - 15, 64 - 79, 140 - 155, 200 - 215, 280 - 295.
How can I accomplish this?