Python Sliding window + Monotonic queue, 90% faster, O(N) time complexity
\nif s[-1] == \'1\':\n\treturn False\nn = len(s)\nmemo = [False] * n\ndq = deque([n-1,]) #only keep index that satisfies \'memo[index]==True\' in this monotonic
```\nif s[-1] == \'1\':\n\treturn False\nn = len(s)\nmemo = [False] * n\ndq = deque([n-1,]) #only keep index that satisfies \'memo[index]==True\' in this monotonic queue\n#Start to slide window\uFF1A\nfor i in range(n-2,-1,-1):\n\tif s[i] == \'1\':\n\t\tmemo[i] = False\n\t\tcontinue\n\twhile dq and i + maxJump < dq[-1]:\n\t\tdq.pop()\n\t#so far, we can at least sure that: dq[-1] <= i + maxJump, but this is not enough, we still need to check if dq[-1] >= i + minJump\n\tif dq and dq[-1] >= i + minJump:\n\t\tmemo[i] = True\n\t\tdq.appendleft(i)\n\telse: #maybe because the queue is empty now, or maybe the queue still contains some elements/idx, but none of them falls within the window scope of the current i (ps:the window scope for current i is [i+minJump: min(i+maxJump,n-1)])\n\t\tmemo[i] = False\nreturn memo[0]\n```
[]