'''

public class Solution {

public int[] maxSlidingWindow(int[] nums, int k) {

```
if(nums.length == 0)
return new int[0];
int[] ans = new int[nums.length - k + 1];
int t = 0;
PriorityQueue<Integer> queue = new PriorityQueue<>(Collections.reverseOrder());
int n = nums.length;
for(int i = 0; i < k; i++) {
queue.add(nums[i]);
}
ans[t++] = queue.peek();
int i = k;
while(i < n) {
queue.remove(nums[i - k]);
queue.add(nums[i]);
ans[t++] = queue.peek();
i++;
}
return ans;
}
```

}

'''

Can someone help me figure out the time complexity of this accepted solution ? I have just started learning priority queues.

Thanks!!