Company: IBM
Difficulty: medium
Problem Title: Maximum Meetings with Positive Effectiveness Index A product manager has to organize n meetings with different people. Meeting with each person results in an increase or decrease in the effectiveness index of the manager. The manager wants to organize the meetings such that the index remains positive for as many meetings as possible. Find the maximum number of meetings for which the effectiveness index is positive. The index at the beginning is 0 . Note: After the meetings begin, the index must remain above 0 to be positive. Input Format The input consists of: An integer n , the number of meetings. An array effectiveness of size n , where each element represents the increase or decrease in effectiveness for each meeting. Output Format Return a single integer representing the maximum possible number of meetings while maintaining a positive index. Constraints 1 ≤ n ≤ 10 5 -10 3 ≤ effectiveness[i] ≤ 10 3 Examples Input: n = 4 effectiveness = [1, 20, 3, -2] Output: 3 One opt