Codeagon question

Revision en3, by silent__killer1, 2019-02-07 12:30:13

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 ...

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English silent__killer1 2019-02-07 12:30:13 52
en2 English silent__killer1 2019-02-07 12:24:57 40
en1 English silent__killer1 2019-02-07 12:24:09 463 Initial revision (published)