pls share the approaches
Can be solved with Basic DP.
Let dp[i] = solution of the array for 1 to i positions i.e. first i elements.
dp[i] = max[dp[j]+sum(j, j-1 + (i-j+1)/2)] such that j<i and length[j,i] = even
Base Case: dp = 0;
pls elaborate a little with further explanation