Given an array find the subsequence that gives maximum alternate sum. Alternate sum of A = [5,4,3,2,1] = 5–4+3–2+1 Link to problem Example :
A = [3,1,5,9,10,4,6,8,7,2] the subsequence that gives maximum would be [3,1,10,4,8] Solution Brute force would be to consider adding +/- sign to each index or not have…