Company: Salesforce Amts_3april
Difficulty: medium
Salesforce's Service Cloud system manages case logs sent by various departments. Each log is queued for processing and delivered to the support team. A 2D array requests of size n × 2 is given, where each element requests[i] contains two values: the time t=requests[i][0] and the number of case logs requests[i][1] to be submitted for processing. The processing pipeline has the following constraints: The queue can hold at most max_cases case logs at a time. The system processes rate case logs per second, meaning it removes rate case logs from the queue every second and forwards them to the support team. If the number of case logs exceeds the queue's capacity ( max_cases ) at any point, the overflow case logs are dropped. Given the array requests , the integers max_cases , and rate , determine the total number of case logs that are dropped due to overflow. Example Suppose requests = [[1, 8], [4, 9], [6, 7]], rate = 2, and max_cases = 10. Time Cases in Queue Cases Submitted Total Cases Dro