Count Subarrays Where Max Element Appears at Least K Times
Slide a window that counts occurrences of the maximum and add every start that still holds at least k of them.
Slide a window that counts occurrences of the maximum and add every start that still holds at least k of them.