about | help | code help+videos | done | prefs |
Write a method that returns the list of people in 'strs' prioritized using the priorities in 'priority'. Prioritizing works by placing all the people into a new array with all the priority 1's first, then all the priority 2's, and so on until the number representing the lowest priority is reached. Priorities could range from 1 to 10000, but might not all be present and might have some missing. For example, there could be priorities 1, 2, 5, and 7 but no others, or any other combination of the numbers 1 through 10 (inclusive) april25_2016_HL_priorityList([5, 2, 1, 4, 1, 5, 2, 1, 1], ["Tom", "Sally", "George", "Dan", "Harry", "Sam", "Ike", "Susan", "Ralph"]) → ["George", "Harry", "Susan", "Ralph", "Sally", "Ike", "Dan", "Tom", "Sam"] april25_2016_HL_priorityList([7, 3, 3, 3], ["Pat", "Don", "Sam", "Tim"]) → ["Don", "Sam", "Tim", "Pat"] april25_2016_HL_priorityList([4, 3, 2, 1], ["Pat", "Don", "Sam", "Tim"]) → ["Tim", "Sam", "Don", "Pat"] ...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: 290
Copyright Nick Parlante 2017 - privacy