← ALL NOTES
Array

2962. Count Subarrays Where Max Element Appears at Least K Times

Given nums and k, count the subarrays in which the maximum element of the whole array appears at least k times. Sliding window on the count of the global maximum's occurrences: count subarrays…

Loading…