Algo++ : Mixtures

My code is getting wrong answer for 4 test cases. My approach is ,I mixed 2 paints at position i and i+1, and updated their value in array and asked recursion to solve from (start,i) and (i+1,end).
if Mixing i and i+1 does not give minimum smoke , I again changed their value to original value . code link : https://ide.codingblocks.com/s/108374

Hello @amandahiya.3572,

I would suggest you to dry run your code on the following testcase:
10
41 67 34 0 69 24 78 58 62 64
Expected Output:
12979
Your Output:
12295

Do the necessary modifications in the code, also comment the modifications you have implemented.
Try hard.

Hope, this would help.
Give a like, if you are satisfied.