[LeetCode] Count Subarrays Where Max Element Appears at Least K Times

1 · · Dec. 10, 2023, 3:09 a.m.
10033. 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 sequence of elements within an array. ...