Oracle Interview Question

It was something related to a sliding window, a medium-level LeetCode