about | help | code help+videos | done | prefs |
Write a method that returns the string with the highest rating. You will be passed a string array and an integer array of the same length. These arrays may be empty, in which case you must return an empty string. Otherwise return the string that has the greatest number associated with it. If there are ties for the highest rating, return the FIRST of these strings that tied. Always remember to look carefully at the test data before you get too far into your code. drWhoRatings(["A", "B", "C", "D", "E", "F"], [45, 128, -34, 128, 128, 45]) → "B" drWhoRatings(["y", "y", "z"], [-7, -7, -6]) → "z" drWhoRatings(["run", "jump", "hide", "smile, we're alive!"], [2, 2, 2, 4]) → "smile, we're alive!" ...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: 250
Copyright Nick Parlante 2017 - privacy