Back to problems

Solve Time-Window and Binary Swap Problems

Algorithm · SoFi · Hard

First task: An online service records when each request arrives. You are given requestTimes, a list of non-negative integers already sorted in non-decreasing order, where requestTimes[i] is the second at which the i-th request arrived. You are also given a non-negative integer windowSize. Return the greatest possible count of arrivals that can fall inside a single inclusive interval of the form $$[t, t + \text{windowSize}]$$ seconds. Since the interval is closed, arrivals at…

Checking your access…