Find the absolute sum b/w consecutive elements in array and add it. Replace all occurrences of given number in the array and repeat the procedure.