LeetCode | 1838. Frequency of the Most Frequent Element | Sliding Window | PrefixSum

Опубликовано: 04 Август 2026
на канале: Compl3x
7,380
100

The frequency of an element is the number of times it occurs in an array.

You are given an integer array nums and an integer k. In one operation, you can choose an index of nums and increment the element at that index by 1.

Return the maximum possible frequency of an element after performing at most k operations.

#leetcode #dsa #slidingwindow #prefixsum