Company: Linkedin_19_dec
Difficulty: medium
Maximum Meetings with Positive Effectiveness Problem Description A product manager has n meetings to schedule with different people, and each meeting either raises or lowers the manager's effectiveness index. The manager wants to arrange the meeting order so that the index stays positive for as many meetings as possible. Work out that largest possible count. The index starts out at 0. Note: Once meetings are underway, the index counts as positive only while it stays above 0. Example Given n = 4 and effectiveness = [1, -20, 3, -2] . One optimal meeting order is [3, -2, 1, -20] . The effectiveness index is positive for the first three meetings. After meeting 1 (value 3): index = 3. (Positive) After meeting 2 (value -2): index = 3 - 2 = 1. (Positive) After meeting 3 (value 1): index = 1 + 1 = 2. (Positive) After meeting 4 (value -20): index = 2 - 20 = -18. (Not positive) The index remains positive for 3 meetings, and no ordering can stretch that to all 4. So, the answer is 3. Function Des