Company: Uber_14july
Difficulty: medium
Maximize the Power Problem Description Given an array `arr` of `n` integers and an array `power` of `k` integers where `k` is an even number. Select two integers `i` and `j` such that `0 If `power[0]` is even, add the sum of the subarray `arr[i...j]` to `power[0]`. If `power[0]` is odd, add the sum of the subarray `arr[i...j]` to `power[1]`. Delete the first two elements from `power`, reducing its length by 2. Using the initial `power` array, maximize the final `power` after applying `k/2` operations. Return the maximum `power` modulo (10^9 + 7). Note: Subarray `arr[i...j]` denotes the elements `arr[i], arr[i+1], ..., arr[j]`. Examples Example 1: Input: arr = [3, 5, 6, 0, 7], power = [3, 1, 0, 2] Output: 25 Explanation: `k = 4`, the size of `power`, so perform `k/2 = 2` operations. One optimal approach is shown: Select `i=0, j=2`. Here, `power[0]=3` and `power[1]=1`. `power[0]` is odd. Add the sum of subarray `arr[0...2]` (`3+5+6 = 14`) to `power[1]`. `power` is `[3, 1+14, 0, 2]` i.e.,