Company: Infosys SP-Off campus -17-May-26-Slot-1
Difficulty: medium
You are given N intervals, each defined by a start time l[i] , an end time r[i] , and an associated score s[i] . Your task is to calculate the maximum possible sum of scores . This sum is achieved by selecting an optimal single time point t such that all intervals [l[i], r[i]] containing t (i.e., l[i] ≤ t ≤ r[i] ) contribute their scores to the total. Find the maximum possible sum of scores . Input Format The first line contains a integer, N , denoting the number of intervals. Each of the N lines contains 3 space-separated integers, representing row i of intervals. Constraints 1 ≤ N ≤ 10^5 0 ≤ intervals[i][j] ≤ 10^9 Sample Test Cases Case 1 Input: 2 1 5 10 3 7 15 Output: 25 Explanation: Choosing time point t=3 includes both the interval [1, 5] (score 10) and [3, 7] (score 15), yielding a total score of 25. This is the maximum possible sum as both intervals overlap at this point. Case 2 Input: 2 1 2 100 5 6 200 Output: 200 Explanation: The intervals [1, 2] and [5, 6] d