Maximize absolute difference
<p>Given an array of coins each having some value.Array size is N. You can change the value of any any coin except the first and last coin. You can change the value of ith coin to half of sum
of value of (i-1)th and (i+1)th coin but for doing so, two condition needs to be satisfied.</p>

<p>(1) value of both (i-1)th and (i+1)th coin should be even and</p>

<p>(2) if jth coin's value is changed after ith coin's value then j should be greater than i</p>

<p>Now your task is to maximize the absolute difference between the sum of values of 1st half of  coins of array and values of 2nd half of the coins of array. If array size is odd ignore middle element.</p>

<p>Can anyone suggest me the algo to find the answer.</p>

<p>The task is to find the maximum absolute diffeerence. </p>

<p>My algo:
1. find sums of left half and right half
2. if left half> right half maximize left half by making operations given and minize left half but i am not geting correct answer.</p>

<p>PS: I attended one interview one week before. It was asked there I could not figure out the approach.</p>