title: Finding minimum cost to reach the end of array
body: <p>An array of costs was given. You can either take two jumps forward or one jump backward. If you land on a particular index, you have to add the cost to your total. Find the minimum cost needed to cross the array or reach the end of the array.</p>
  <p><strong>Input:</strong></p>
  <pre><code>5 (Number of elements in the array)
  
  [9,4,6,8,5] (Array)
  
  1 (Index to start)
  </code></pre>
  <p><strong>Output:</strong></p>
  <pre><code>12
  </code></pre>
  <p>Explanation: We start from index 1, jump to 3 and then jump out for a total cost of 8+4=12.</p>
  <p>How can we build the DP solution for this?</p>