1838. Frequency of the Most Frequent Element
https://leetcode.com/problems/frequency-of-the-most-frequent-element
Description
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.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= nums.length <= 105
1 <= nums[i] <= 105
1 <= k <= 105
ac
Last updated