Lyft interview question

Sliding window problem if I remember correctly.