Maximize Combined Reward Points

Company: Microsoft_9october

Difficulty: medium

Problem Statement

Maximize Combined Reward Points Problem Description Two interns are assigned a total of n tasks. Each task is completed by exactly one of them. The first intern earns reward_1[i] points for finishing the i -th task, while the second intern earns reward_2[i] points for the same task. The first intern is required to complete exactly k tasks, and the second intern completes the remaining n - k tasks. The k tasks of the first intern can be any of the n tasks. Determine the highest possible combined reward points of both interns. For example, with n = 5 , reward_1 = [5, 4, 3, 2, 1] , reward_2 = [1, 2, 3, 4, 5] and k = 3 : intern 1 takes the first 3 tasks and intern 2 takes the last 2. The total is 5 + 4 + 3 (from intern 1) + 4 + 5 (from intern 2) = 21 , which is the maximum possible. Function Description Complete the function getMaximumRewardPoints . Parameters: k (int): the number of tasks that must be completed by intern 1. reward_1 (int[n]): the reward points earned by intern 1 for each