Company: Wayfair
Difficulty: medium
Maximum Taxi Revenue A taxi driver knows the pick-up and drop-off locations of people who are requesting taxi services. All the locations are in km from the starting point. The starting point is at 0 km . For each km travelled by a passenger, the driver charges 1 unit of money per passenger. Moreover, the taxi itself is very fancy. Therefore some people are even willing to pay an extra tip if they get to travel in the taxi. At any point of time, the taxi can only accommodate one passenger. Determine the maximum amount the driver can earn. Function Description Complete the function taxiDriver in the editor below. The function must return an integer denoting the maximum amount that can be earned by the driver. Parameters: pickup[pickup[0],...,pickup[n-1]] : an array of n integers that denote the pickup location of the potential riders drop[drop[0],...,drop[n-1]] : an array of n integers that denote the drop-off locations of the potential riders tip[tip[0],...,tip[n-1]] : an array of n in