you can first make the array equal to [3,3,5] in one move and then make it equal to [4,5,5] in the next, making the sum equal to 14. Notice that the condition is that a_i is different only to a_(i+1) and it doesn't specify that for example it has to be different from a_(i-1).
you can first make the array equal to [3,3,5] in one move and then make it equal to [4,5,5] in the next, making the sum equal to 14. Notice that the condition is that a_i is different only to a_(i+1) and it doesn't specify that for example it has to be different from a_(i-1).