DP + Sliding Window | O(N) | Single Pass
We use a DP + Sliding window approach to solve this problem:\n\t We keep a count of the number of indices in a window of size maxJump-minJump   from which we ca
* We use a DP + Sliding window approach to solve this problem:\n\t* We keep a count of the number of indices in a window of size `maxJump-minJump`   from which we can reach current index \'i\'.\n\t* We also decerement count if there was a possiblity to reach current index i from `i-maxJump-1`, as we can no longer jump from that index to reach  current `\'i\'` as it\'s no longer a part of the sliding window.\n\t* Finally, for the current index i if the `count > 0` , this means that there is atleast one way to reach from the window `(i-maxJump, i-minJump)` to our `i`, so we set the `dp[i] = 0` in this case, with the added check that `s[i]==\'0\'`.\n**Feel free to drop your queries in the comment box**\n```\nclass Solution {\npublic:\n    bool canReach(string s, int mi, int ma) {\n \xA0 \xA0 \xA0 \xA0if(s.back()==\'1)return false; // In case the last character is \'1\', we\'ll never be able to reach the end.\n        vector<bool>dp(s.size());\n        dp[0] = true;\n        int count = 0;\n        for(int i = 1; i<s.size(); i++){\n            if(i>ma){\n                count-=dp[i-ma-1]; //Moving sliding window forward by decrementing the count by the dp value of the index that is no longer in our window\n            }\n            if(i>=mi){\n                count+=dp[i-mi];\n            }\n            if(count>0&&s[i]==\'0\')dp[i] = true;\n            else dp[i] = false;\n        }\n        return dp.back();\n    }\n};\n```
['Dynamic Programming', 'C', 'Sliding Window']