title: reduce every element of the array to zero
body: <p>i have an array consist of only non negative integers. now i want to reduce every element to zero. the only operation allowed is 'decrement each element in the range i,j by 1' cost of each such operation is 1. now question is how to find the minimum number of such operation that can transform this array to all zero element array.</p>
  
  <pre><code>example: [1 2 3 0]
  ---&gt;[0 1 2 0] (decrement all element in the range 0 to 2)
  ---&gt;[0 0 1 0] (----------------------------range 1 to 2)
  ---&gt;[0 0 0 0] (----------------------------range 2 to 2)
  </code></pre>