Question: Write a method called rarest that accepts a map whose keys are strings and whose values are integers as a parameter and returns the integer
Write a method called rarest that accepts a map whose keys are strings and whose values are integers as a parameter and returns the integer value that occurs the fewest times in the map. If there is a tie, return the smaller integer value. If the map is empty, throw an exception.
Step by Step Solution
3.51 Rating (174 Votes )
There are 3 Steps involved in it
public static int rarest Map m if m null misEmpty throw new IllegalArgumentExcep... View full answer
Get step-by-step solutions from verified subject matter experts
