Maximum Average Pass Ratio With Extra Students
Maximize average pass ratio by distributing extra students among classes using max-heap and greedy approach.
1792. Maximum Average Pass Ratio Difficulty: Medium Topics: Array, Greedy, Heap (Priority Queue) There is a school that has classes of students and each class will be having a final exam. You are given a 2D integer array classes, where classes[i] = [passi, totali]. You know beforehand that in the ith class, there are totali total students, but only passi number of students will pass the exam. You are also given an integer extraStudents. There are another extraStudents brilliant students that are guaranteed to pass the exam of any class they are assigned to. You want to assign each of the extra...