Sliding Window Maximum (LeetCode 239)The problem You get an integer array and a window size . A window of…