Can anyone help in this Q? I thought of BS on search space but couldn't write isPossible function

Revision en2, by DhruvBohara, 2023-10-12 00:10:10

John has invested in this great app designed by Big Head that can help scale big restaurants: The restaurants have N customers which are represented by an array A of size N*3 where arrival time, departure timer, and the number of dishes X ordered by the customer are denoted by the row of array A

The app calculates the minimum number of chefs the restaurant needs to hire to make dishes to fulfill the orders of all N customers. One chef can only make one dish in one unit of time and each dish takes a unit of time to be prepared.

Help John to determine the minimum number of chefs required

to fulfill the orders of all the N customers.

Parameters description

N. Represents the number of customers

A Represents the array that denotes the details of the N customers

Constraints: 1<=N <=2*10^5 1<=l<=r<=10^9 1<=X<=10^9

#### History

Revisions

Rev. Lang. By When Δ Comment
en2 DhruvBohara 2023-10-12 00:10:10 6
en1 DhruvBohara 2023-10-12 00:09:18 939 Initial revision (published)