LeetCode 1343 Number of Subarrays of Size K and Average Greater than Equal to Threshold

link to the problem This is sliding window problem. Let’s see how sliding window elegantly solves the problem. Bruteforce: generate all subarrays of size k. Then compute the average of all the subarrays that are greater than equal to the threshold.Time complexity is O(n^2) for generating subarrays and computing the average. Is there a better READ MORE