[Python|Javascript] Deque
python\nfrom collections import deque \n\nclass Solution:\n    def canReach(self, s: str, minJump: int, maxJump: int) -> bool:\n        valid_idxs = deque([0])\
```python\nfrom collections import deque \n\nclass Solution:\n    def canReach(self, s: str, minJump: int, maxJump: int) -> bool:\n        valid_idxs = deque([0])\n        for i in range(1, len(s)):\n            # skip if character is a 1 OR\n            # if all of the valid indexes are too close\n            if s[i] == \'1\' or i - valid_idxs[0] < minJump:\n                continue\n\n            # remove all the indexes that are too far\n            while valid_idxs and i - valid_idxs[0] > maxJump:\n                valid_idxs.popleft()\n\n            # if there are no valid indexes that can reach this index\n            # return false\n            if not valid_idxs:\n                return False\n\n            valid_idxs.append(i)\n\n            # return true if we are at the last index\n            # and there is an index that is within the range\n            if i == len(s) - 1:\n                return i - valid_idxs[0] >= minJump\n            \n        # if the last character is a 1 we must return False\n        return False\n```\n\n```javascript\nvar canReach = function(s, minJump, maxJump) {\n    const validIdxs = [0];\n    for (let i = 0; i < s.length; i++) {\n        // skip if character is a 1 or if all the \n        // valid indicies are too close\n        if (s[i] === \'1\' || i - validIdxs[0] < minJump) {\n            continue;\n        }\n        \n        // remove all the indexes that are too far\n        while (validIdxs.length && i - validIdxs[0] > maxJump) {\n            validIdxs.shift();\n        }\n        if (validIdxs.length === 0) {\n            return false;\n        }\n        \n        validIdxs.push(i);\n        \n        // if we are at the last index\n        // return if we have an index within range\n        if (i === s.length - 1) {\n            return i - validIdxs[0] >= minJump;\n        }\n    }\n    // if the last character is a 1 we must return False\n    return false;\n};\n```
['Queue', 'Python', 'JavaScript']