C++ BIT Solution.
Idea\n- we can get the left-bound and right-bound by the current position, the current position can be arrived if bit.query(right) - bit.query(left - 1) > 0.\n-
### Idea\n- we can get the left-bound and right-bound by the current position, the current position can be arrived if bit.query(right) - bit.query(left - 1) > 0.\n- if a position can be arrived, then bit.update(pos, 1)\n\n\n### Solution\n- C++\n```\nstruct BIT{\n    vector<int> nums;\n    BIT(int size) : nums(size){}\n    int lowbit(int x) { return x & -x; }\n    void update(int x, int cnt){\n        while (x < nums.size()) {\n            nums[x] += cnt;\n            x += lowbit(x);\n        }\n    }\n    \n    int query(int x) {\n        int sum = 0;\n        if(x <= 0) return 0;\n        while(x > 0) {\n            sum += nums[x];\n            x -= lowbit(x);\n        }\n        return sum;\n    }\n};\n\nclass Solution {\npublic:\n    bool canReach(string s, int minJump, int maxJump) {\n        vector<int> dist;\n        if(s.back() == \'1\') return false;\n        if(s.size() == 1) return true;\n        for(int i = 0; i < s.size(); i++){\n            if(s[i] == \'0\') dist.push_back(i + 1);\n        }\n        BIT bit(1e5 + 10);\n        bit.update(1, 1);\n        for(int i = 1; i < dist.size(); i++) {\n            int r = dist[i] - minJump;\n            int l = max(1, dist[i] - maxJump);\n            if(r <= 0) continue;\n            if(bit.query(r) - bit.query(l - 1) == 0) {\n                continue;\n            }\n            if(i + 1 == dist.size()) return true;\n            bit.update(dist[i], 1);\n        }\n        return false;\n    }\n};\n```
[]