title: How to find minimum number of jumps to reach the end of the array in O(n) time
body: <blockquote>
    <h3>Question</h3>
    
    <p>Given an array of integers where each element represents the max number of steps that can be made forward from that element.
    Write a function to return the minimum number of jumps to reach the
    end of the array (starting from the first element). If an element is
    0, then cannot move through that element.</p>
    
    <h3>Example</h3>
    
    <p>Input: arr[] = {1, 3, 5, 8, 9, 2, 6, 7, 6, 8, 9}<br>
    Output: 3 (1-> 3 -> 8 ->9)</p>
  </blockquote>
  
  <p>Found multiple ways from <a href="http://www.geeksforgeeks.org/minimum-number-of-jumps-to-reach-end-of-a-given-array/" rel="noreferrer">Dynamic Programming approach</a> to other linear approaches. I am not able to understand the approach which is said to linear in time. <a href="http://www.lifeincode.net/programming/leetcode-jump-game-and-jump-game-ii-java/" rel="noreferrer">HERE</a> is the link where a linear approach is proposed. </p>
  
  <p>I am not able to understand it at all. What I could understand is that author is suggesting to do a greedy approach and see if we reach end  .. if not then backtrack ?</p>