Company: Microsoft_5march
Difficulty: medium
Given an array of integers, arr[n], you can perform the following operation up to k times: Choose an index i such that 0 ≤ i < n Replace arr[i] with arr[i] × 2 The or-sum is the bitwise-OR of all elements in the final array after operations. Return the maximum possible or-sum. Example arr = [12, 9] k = 1 Possible outcomes after 1 operation: Select i = 0: arr = [24, 9], or-sum = 24 | 9 = 25 Select i = 1: arr = [12, 18], or-sum = 12 | 18 = 30 Return: 30 (the maximum possible or-sum) Function Description Complete the getMaxOrSum function in the editor with the following parameters: int arr[n]: the original array int k: the maximum number of operations Returns long int: the maximum possible or-sum Constraints 1 ≤ n ≤ 10 5 1 ≤ arr[i] ≤ 10 6 1 ≤ k ≤ 11 Input Format For Custom Testing Sample Case 0 Sample Input For Custom Testing STDIN FUNCTION ----- -------- 2 → n = 2 10 → arr = [10, 1] 1 1 → k = 1 Sample Output 21 Explanation Select i = 0. The fi