You are given an array A of n integers.The value of this array is defined as the sum of absolute value of differnce of consecutive elements in the array.↵
Example |a2-a1|+|a3-a2|+.....|an-an-1|.you are allowed to select any subarray and reverse it.You can perform this operation only once.find the max value of the array achievable.↵
↵
n=no of elements in an array.↵
ex-↵
n=5↵
↵
2 3 1 5 4↵
ans-10↵
↵
n=7↵
↵
2 4 9 24 2 1 10↵
ans-68↵
↵
↵
↵
↵
question link--https://imgur.com/a/sRq1LTg↵
↵
i really didnt get how to do that please anyone ...
Example |a2-a1|+|a3-a2|+.....|an-an-1|.you are allowed to select any subarray and reverse it.You can perform this operation only once.find the max value of the array achievable.↵
↵
n=no of elements in an array.↵
ex-↵
n=5↵
↵
2 3 1 5 4↵
ans-10↵
↵
n=7↵
↵
2 4 9 24 2 1 10↵
ans-68↵
↵
↵
↵
↵
question link--https://imgur.com/a/sRq1LTg↵
↵
i really didnt get how to do that please anyone ...