using Top Down approach ,dp, runtime-68ms
class Solution {\npublic:\n    \n    int dp[100001];\n    bool check(int i,int &minjump,int &maxjump,string &s,vector&v)\n    {\n        if(i==v.size()-1)   // 
class Solution {\npublic:\n    \n    int dp[100001];\n    bool check(int i,int &minjump,int &maxjump,string &s,vector<int>&v)\n    {\n        if(i==v.size()-1)   // if u have reached the last position and if the last position is zero return true\n        {\n            if(s[v[i]]==\'0\')\n                return true;\n            else\n                return false;\n        }\n        if(dp[i]!=-1)return dp[i];\n        \n\t\tbool res=false;\n\t\t\n\t\t // from the current position i u can take jump anywhere which is feasible i.e that value of j which satisfies the condition\n\t\t \n        for(int j=i+1;j<v.size();j++)  \n        {\n            int k=0;\n            if(maxjump+v[i]<s.size()-1)\n            {\n                k=maxjump+v[i];\n            }\n            else\n            {\n                k=s.size()-1;\n            }\n            if(v[i]+minjump<=v[j] && v[j]<=k)\n            {\n\t\t\t     // if the further state is already computed dont go further because we only need one such possibile sequence of steps which reaches the end\n\t\t\t\t \n                if(dp[j]!=-1)\n                {\n                    break;\n                }\n                res|=check(j,minjump,maxjump,s,v);\n                if(res)break;   // any one sequence found just break\n            }\n        }\n        return dp[i]=res;\n    }\n    bool canReach(string s, int minjump, int maxjump) {\n        \n\t\tif(s[s.size()-1]!=\'0\')return false;\n\t\t\n        vector<int>v; // vector which stores the position of zeroes\n        \n\t\tmemset(dp,-1,sizeof(dp));\n        for(int i=0;i<s.size();i++)\n        {\n            if(s[i]==\'0\')\n            {\n                v.push_back(i);\n            }\n        }\n        return check(0,minjump,maxjump,s,v);\n    }\n};\n
['Dynamic Programming', 'Memoization']