Count Subarrays Where Max Element Appears at Least K Times at Meta
Medium62.4% acceptance
This problem has 12.5% frequency at Meta.
Problem Description
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.
Read full problem and hintsTopics
Also asked at 5 companies
More Meta Questions
Kth Largest Element in an ArrayMediumTwo SumEasyMerge IntervalsMediumMerge Sorted ArrayEasyFind Peak ElementMedium
View all Meta questions