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

 

frew@mclean.com > rarest
prev  |  next  |  chance

Write a method that accepts a map whose keys are strings and whose values are integers (in the form of 2 arrays) as a parameter and returns a list of Strings whose integer is the rarest. In the case of a tie, return the smallest rare integer's String list. You may only use one loop.


rarest(["Alyssa", "Char", "Dan", "Jeff", "Kasey", "Kim", "Morgan", "Ryan", "Stef"], [22, 25, 25, 20, 20, 20, 25, 25, 22]) → ["Alyssa", "Stef"]
rarest(["Alyssa", "Char", "Dan", "Jeff", "Kim", "Morgan", "Ryan", "Stef"], [22, 25, 25, 20, 20, 25, 25, 22]) → ["Jeff", "Kim"]

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

public List rarest(String[] keys, int[] values) { }

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: 350

Copyright Nick Parlante 2017 - privacy