Company: Cisco_AI_Intern__
Difficulty: medium
Maximize Score Problem Description In a new game, players must maximize their score by performing operations on an integer array until its length is reduced to one. Starting with a score of zero, players must execute exactly n-1 operations. Each operation consists of the following steps: Decreases the array length by one. Requires selecting two indices x and y from the current array. Adds arr[x] ⊕ arr[y] to the score (where ⊕ represents bitwise XOR). Removes either arr[x] or arr[y] from the array. Return the highest possible score achievable through optimal operations. Examples Example 1: Input: n = 3 arr = [3, 2, 1] Expected Output: 6 Explanation: An optimal method (using 1-based indexing for the explanation): The array is [3, 2, 1] . Choose the elements at index 2 (value 2) and index 3 (value 1). Add 2 ⊕ 1 = 3 to the score. Remove the 2 nd element (value 2). The score is now 3 and the array is [3, 1] . The array is [3, 1] . Choose the elements at index 1 (value 3) a