id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

maxRepeat


Given a non-empty array of integers, some numbers might appear multiple times. Return the maximum number of times that any number appears in the array. For example, given the array {7, 1, 3, 1, 7, 2, 3, 7}, the number 1 appears 2 times, the number 3 appears 2 times, and the number 7 appears 3 times. So, the maximum number of times a number appears is 3. Solve this without modifying the given array or creating a new array.


maxRepeat([7, 1, 3, 1, 7, 2, 3, 7]) → 3
maxRepeat([1, 2]) → 1
maxRepeat([4, 4, 4, 4, 4]) → 5

...Save, Compile, Run (ctrl-enter)

int maxRepeat(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 300

Copyright Nick Parlante 2017 - privacy