Problem Brief
Calculate Mean and Mode
INTERNOA
See Cisco online assessment and hiring insights
Given an integer inputNum, representing the number of elements in the set (N).
The next line consists of N space-separated integers representing the elements of the given set.
Print K space-separated integers where the first number is the mean of the input numbers and the second number is the mode (where K=2).
Note
If mean calculated is in decimal, print its floor value (Floor is the greatest integer less than or equal to that number: floor[2.4] = 2).
1Example 1
Input
inputNums = [1, 2, 7, 3, 2]
Output
[3, 2]
Explanation
The mean for the given set of numbers is 3 (1+2+7+3+2 = 15, 15/2=3). The mode is the most frequently occurring number which is 2.
So, the output is 3, 2.
Constraints
Limits and guarantees your solution can rely on.
๐๐