comefrom: <doocs>1871.Jump Game VII_1.py
code: def canReach( s: str, minJump: int, maxJump: int) -> bool:
      n = len(s)
      dp = [False] * n
      dp[0] = True
      pre_sum = [0] * (n + 1)
      pre_sum[1] = 1
      for i in range(1, n):
          if s[i] == '0':
              l = max(0, i - maxJump)
              r = i - minJump
              if r >= l and pre_sum[r + 1] - pre_sum[l] > 0:
                  dp[i] = True
          pre_sum[i + 1] = pre_sum[i] + dp[i]
      return dp[n - 1]
masked: def sample_funcname ( var_0 : str , var_1 : int , var_2 : int ) -> bool :
      var_3 = len ( var_0 )
      var_4 = [ False ] * var_3
      var_4 [ 0 ] = True
      var_5 = [ 0 ] * ( var_3 + 1 )
      var_5 [ 1 ] = 1
      for var_6 in range ( 1 , var_3 ) :
          if var_0 [ var_6 ] == '0' :
              var_7 = max ( 0 , var_6 - var_2 )
              var_8 = var_6 - var_1
              if var_8 >= var_7 and var_5 [ var_8 + 1 ] - var_5 [ var_7 ] > 0 :
                  var_4 [ var_6 ] = True
          var_5 [ var_6 + 1 ] = var_5 [ var_6 ] + var_4 [ var_6 ]
      return var_4 [ var_3 - 1 ]
  