about | help | code help+videos | done | prefs |
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) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 300
Copyright Nick Parlante 2017 - privacy