title: Return immediately for recursive calls
body: <p>Problem Statement:
  You are given an integer array nums. You are initially positioned at the array's first index, and each element in the array represents your maximum jump length at that position. Return true if you can reach the last index, or false otherwise.</p>
  <p>How can I change my code so that it returns immediately when I have found a path that works for this problem instead of going through all the recursive calls that I have made previously</p>
  <pre><code>def canJump(self, nums: List[int]) -&gt; bool:
      solve = [False]
      def backtrack(i):
          if solve[0] == True:
              return
          
          if i == len(nums)-1:
              solve[0] = True
              return
          
          if i &gt;= len(nums) or nums[i] == 0:
              return
          
          for x in range(1, nums[i]+1):
              backtrack(i+x)
      
      backtrack(0)
      return solve[0]
  </code></pre>