Binary Search | O(n log(n))
Intuition\njust check if the current index is reachable to previous valid indexes by doing a binary search on previous seen eligible indexes. If curr index can 
# Intuition\njust check if the current index is reachable to previous valid indexes by doing a binary search on previous seen eligible indexes. If curr index can reach valid indexes, curr index is also valid. If any future index can reach curr index ( or any other index ) in eligible set `vec`, the future index is also valid.\n\nLastly, check if the index `n-1` is part of eligible set or not. \n\n# Approach\n\n\n# Complexity\n- Time complexity:\n $$O(n log(n))$$\n\n- Space complexity:\n$$O(n)$$\n\n# Code\n```\nclass Solution {\npublic:\n    bool canReach(string s, int minJump, int maxJump) {\n        int n = s.size();\n        vector<int> vec;\n        vec.push_back(0);\n\n        auto binarySearch = [&](int rs, int re) -> bool {\n            int s = 0, e = vec.size() - 1;\n            while (s <= e) {\n                int m = s + (e - s) / 2;\n                if (rs <= vec[m] && vec[m] <= re)\n                    return true;\n                else if (vec[m] < rs) {\n                    s = m + 1;\n                } else if (re < vec[m]) {\n                    e = m - 1;\n                }\n            }\n            return false;\n        };\n\n        for (int i = 1; i < n; i++) {\n            if (s[i] == \'1\')\n                continue;\n            bool bFound = binarySearch(i - maxJump, i - minJump);\n            if (bFound) {\n                vec.push_back(i);\n            }\n        }\n        return vec.back() == n - 1;\n    }\n};\n\n```
['C++']