Lyft Interview Question

Sliding window problem if I remember correctly.