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:
Return the highest possible score achievable through optimal operations.
Complete the function findMaxScore in the editor with the following parameter(s):
n = 3, arr = [3, 2, 1] Expected Output: 5
An optimal method:
Sum the results and return the total score, 3+2 = 5.
2 ≤ N ≤ 2 × 10^5 0 ≤ a[i] ≤ 10^9