Explained Java solution, beat 100%, DP + sliding window, Easy Approach
the idea is : to avoid checking the positions which we have already checked.\n\nfor example, minstep = 2, maxstep = 3\nif we can reach position 0 , we will chec
the idea is : to avoid checking the positions which we have already checked.\n\nfor example, minstep = 2, maxstep = 3\nif we can reach position 0 , we will check postion from 2,3,4,5.\nif we can reach position 1,  we will check  3,4,5,6 . but  we have already checked 3,4,5 , so we go to skip these positions to save time.\n![image](https://assets.leetcode.com/users/images/87f43a68-dc3d-46a0-ae11-02dd215d6583_1639211770.156945.jpeg)\n\n```\nclass Solution {\n    public boolean canReach(String s, int minJump, int maxJump) {\n        if(s == null || s.length() == 0) return false;\n        int n = s.length();\n        if(s.charAt(0) == \'1\' || s.charAt(n - 1) == \'1\') return false;\n        \n        \n        boolean[] dp = new boolean[n];\n        dp[0] = true;\n        \n        int start = 0;  //the start index of sliding windows to check\n        int end = 0;  //the end index of sliding windows to check\n        for(int i = 0; i < n; i++){\n            if(!dp[i]){    // quick skip, if current position can\'t reach\n                continue;\n            }\n            \n            start = Math.max(end + 1, i + minJump);  // skip the position already checked\n            end = Math.min(n - 1, i + maxJump);  // avoid overflow\n \n            for(int j = start; j <= end; j++){\n                if(s.charAt(j) == \'0\'){\n                    dp[j] = true; \n                }                \n            }\n            if(dp[n - 1]) return true;\n        }\n        return dp[n-1];\n    }\n}\n```
['Dynamic Programming', 'Sliding Window', 'C++', 'Java']