Problem

you are given an array and you have to make it non-decreasing with the minimum operations.
operation:- merge(add) two adjacent elements.
testcase -:
7
5 4 4 3 11 12 13
output = 2
explanation-> 0-based indexing,

  1. merge index 1 element with index 2 element then array → 5 8 3 11 12 13
  2. again merge index 1 element with index 2 element → 5 11 11 12 13
    so, two operations aare required to make the array non decreasing.

thanks for the help