the alternate sum 0indexed array define sum element index minus sum element odd indicesFor example alternate sum 4253 4 5 2 3 4given array num return maximum alternate sum subsequence num reindexe element subsequencea subsequence array new array generate original array delete element possibly change remain element relative order for example 274 subsequence 4237214 underline element 242 example 1input num 4253output 7explanation it optimal choose subsequence 425 alternate sum 4 5 2 7example 2input num 5678output 8explanation it optimal choose subsequence 8 alternate sum 8example 3input num 621245output 10explanation it optimal choose subsequence 615 alternate sum 6 5 1 10 constraints1 numslength 1051 numsi 105