C++ solution using Binary Search and optimised DP
\nclass Solution {\npublic:\n    // The last parameter "prev" here represents the max index which we would have processed in previous recursion calls so that we
```\nclass Solution {\npublic:\n    // The last parameter "prev" here represents the max index which we would have processed in previous recursion calls so that we can avoid redundancy \n    bool find(int ind,int minj,int maxj,int n,vector<int> &dp,map<int,vector<int>> &m,int prev){\n        //If we reach the end of string return true\n        if(ind==n-1)\n            return true;\n        if(ind>=n)\n            return false;\n        if(dp[ind]!=-1)\n            return dp[ind];\n        bool res=false;\n        // Find the index in array of indexes of \'0\' which are in our jump range\n        //lo-> least index we can jump upon\n        //hi ->highest index we can jump upon\n        int lo=ind+minj,hi=min(ind+maxj,n-1);\n        //l -> index in our array of indexes of\'0\' from where we should start iterating\n        //r-> excluding this index in array of indexes of \'0\'\n        int l=lower_bound(m[0].begin(),m[0].end(),lo)-m[0].begin();\n        int r=upper_bound(m[0].begin(),m[0].end(),hi)-m[0].begin();\n        int sz=m[0].size();\n        //here we have start iteration from max(l,prev) to avoid redundancy i.e same recursion calls which we would have already done in past\n        for(int j=max(l,prev);j<r and j<sz ;j++){\n            res=res or find(m[0][j],minj,maxj,n,dp,m,r);\n            //if we found answer return true\n            if(res)\n                return true;\n        }\n        return dp[ind]=res;\n    }\n    bool canReach(string s, int minj, int maxj) {\n        int n=s.size();\n        if(s[n-1]==\'1\'){\n            return false;\n        }\n        //dp[i]-> represents whether it is possible to reach end of string from ith index i.e dp[i]==0 ->false & dp[i]==1 ->true;\n        vector<int> dp(n,-1);\n        // Store indexes of \'0\' to apply binary search to find range of indexes\n        map<int,vector<int>> m;\n        for(int i=0;i<n;i++){\n            if(s[i]==\'0\'){\n                m[s[i]-\'0\'].push_back(i);\n            }\n            else if(s[i]==\'1\'){\n                m[s[i]-\'0\'].push_back(i);\n            }\n        }\n        return find(0,minj,maxj,n,dp,m,0);\n        \n        \n    }\n};\n```
[]