Description
Solutions
Find Maximum Frequency of Number
π©βπ NEW GRADπRELATED PROBLEMS
Given a sorted array, find the maximum frequency of a number.
Example: [1,2,2,3,3,3,3,4,4,5,6] : Answer: 4 (3 is repeated 4 times).
O(N) is a straightforward solution. Asked if the performance can be improved.
Example 1:
Input: nums = [1,2,2,3,3,3,3,4,4,5,6]
Output: 4
Explanation:In the given array, the number 3 appears the maximum number of times, which is 4 times.
Constraints:
ππ

Related Problems
Testcase
Result
Case 1
input:
output: