10033. Count Subarrays Where Max Element Appears at Least K Times
You are given an integer array
nums
and a positive integerk
.Return the number of subarrays where the maximum element of
nums
appears at leastk
times in that subarray.A subarray is a contiguous sequence of elements within an array.
c++
1 | class Solution { |