Given an array and a window size w, slide the window across the array one element at a time. For each window, return the top K largest elements in it, not just the maximum. An example of ours (the report gives none): The naive answer copies each window, sorts it…