C++ Solution using set and lower_bound
It\'s not as fast as some other methods, just wanted to share this approach.\n\nclass Solution {\npublic:\n    bool canReach(string s, int minJ, int maxJ) {\n  
It\'s not as fast as some other methods, just wanted to share this approach.\n```\nclass Solution {\npublic:\n    bool canReach(string s, int minJ, int maxJ) {\n        int n = s.size();\n        \n        if(s[n - 1] == \'1\')\n            return false;\n        \n        set<int> st;\n        st.insert(n-1);\n        \n        for(int i = n - 2; i >= 0; --i) {\n            if(s[i] == \'1\')\n                continue;\n            \n            auto pos = st.lower_bound(i + minJ);\n            if(pos == st.end() || *pos > i + maxJ)\n                continue;\n            st.insert(i);\n        }\n        \n        if(st.find(0) != st.end())\n            return true;\n        return false;\n    }\n};\n```
[]