NeetCode #250LC-2962MediumSliding Window
← Back to All Problems

#250 · #2962 · Count Subarrays Where Max Element Appears at Least K Times(统计最大元素出现至少 K 次的子数组)

📌 Problem Statement & Constraints

You are given an integer array nums and a positive integer k. Return the number of subarrays in which the maximum element of nums appears at least k times. Constraints: 1 <= nums.length <= 10^5, 1 <= nums[i] <= 10^9, 1 <= k <= nums.length.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!