Maximize Reviewed Driver Support Chat Load

Company: Uber Oncampus_19july

Difficulty: medium

Problem Statement

Maximize Reviewed Driver Support Chat Load Problem Description Uber keeps a minute-by-minute log of how many driver support chats its system handles. The log is the array chatLoad , where chatLoad[i] is the number of support chats during minute i . During a support system audit, the operations team receives a list of k minutes, the array reviewMinutes , at which spikes in driver support activity were reported. The team investigates the chat volume between pairs of these minutes. One investigation works as follows: Choose two different positions i and j of the current reviewMinutes list ( 0 <= i < j < len(reviewMinutes) ). Let start = min(reviewMinutes[i], reviewMinutes[j]) and end = max(reviewMinutes[i], reviewMinutes[j]) . Add the total chat load from minute start to minute end , both inclusive, that is the sum of the subarray chatLoad[start..end] . Remove both entries (positions i and j ) from reviewMinutes . The investigations are repeated until exactly k / 2 of them are do