Finding The Mode
Start Timer
0:00:00
Write a function to determine the mode of an array of integers.
The list may have one mode, more than one mode, or no mode at all. If the list has multiple modes, return them in ascending order.
Example 1:
Input:
nums = [1, 2, 2, 3, 4]
Output:
mode(nums) -> [2]
Example 2:
Input:
nums = [1,1,2,2]
Output:
mode(nums) -> [1, 2]
Recommended questions for you
Personalized based on your user activity, skill level, and preferences.
.
.
.
.
.
.
.
.
.
Comments