Array Problem

Could not solve.? can anyone help with this.

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.

yes i can do but you give exact input and output then i can implement