Company: uber_6oct
Difficulty: medium
Maximize Driver Earnings Problem Description Uber operations must assign ride requests to drivers to maximize total earnings for a given day. Each ride request has an associated profit, represented as an integer value. Ride requests arrive sequentially throughout the day and must be considered in order. Dispatch rules allow only specific groupings of consecutive ride requests to be assigned together: Up to x single-ride assignments (size 1 subarray) Up to y two-ride bundles (size 2 subarray) Up to z three-ride bundles (size 3 subarray) Each assignment or bundle selected contributes to the sum of its rides' profits. No two assignments may overlap. The goal is to maximize the total profit from all selected assignments. Examples Example 1: Input: requestCount = 6, rideProfits = [3, 7, -2, 5, 4, 6], x = 1, y = 1, z = 2 Output: 25 Explanation: The best two-bundle is [3, 7] = 10. The best three-bundle is [5, 4, 6] = 15. These two do not overlap, so together they give 10 + 15 = 25. Maximum to