Problem · Array
Maximum Concurrent Active Loans
Learn this problemProblem statement
Each funded loan is active during a half-open time interval [start, end): the start time is included and the end time is excluded.
Given all loan intervals, return the maximum number of loans active at the same time.
Function
maxActiveLoans(loans: int[][]) → intExamples
Example 1
loans = [[1,5],[2,6],[4,8],[7,9]]return = 3At time 4, the first three loans are active simultaneously.
Constraints
1 <= loans.length <= 10^5- Every row has exactly two values
[start, end]. 0 <= start < end <= 10^9- A loan ending at time
tdoes not overlap a loan starting at timet.