[LeetCode] 2962. Count Subarrays Where Max Element Appears at Least K Times
You are given an integer array nums and a positive integer k. Return the number of subarrays where the maximum element of nums appears at least k times in that subarray. A subarray is a contiguous seq