Simple Queue Based O(N) solution with Intuition
\nThe question asks to reach a Point i from a Point j ,only if \n    -s[j] = 0\n\t -j >= i + minJump && i <= i + maxJump;\n\t \nHere since  minJump and maxJump 
\nThe question asks to reach a Point `i` from a Point `j` ,only if \n    -s[j] = 0\n\t -j >= i + minJump && i <= i + maxJump;\n\t \nHere since  `minJump` and `maxJump` are dependent on a index of the String we need to store them in a `Queue`.\nWhat I meant is,  `minJump` and `maxJump` are attributes of an index, since they would be changing as index changes.\n\nexample for minJump = `2` and `maxJump` = 5, \n if index = `2` , from here we can travel in range `(4, 7)`\nif index = `4`, from here we can travel in range `(6, 9)`\n\nHence we need to store them in a queue, which could be used later;\n\nNow at any index `i` , we basically check if it is possible to reach i from the below condition\n1.s[i] = 0\n2.we check `Q` if if contains any candidate element through which we can reach index i;\n\nTo calculate the second point. we do the following thing\n```\n while (!q.isEmpty() && done) {\n                        int minIndex = q.peek() + n;\n                       int maxIndex = q.peek() + m;\n                        if (i >= minIndex && i <= maxIndex) {     // to check if the `i` lies within the range if jumping from q.peek() index\n                            dp[i] =true;\n                            q.add(i);\n                            done = false;\n                        } else if (minIndex > i) {             // if it is not possible to reach `i` since the minIndex  > i\n                            done = false;\n                        } \n                       else {                          //  removing not needed index \n                            q.poll();\n                        }\n                    }\n\n```\n\n\n\n\n\n```\n public boolean canReachUtil(String s, int n, int m) {\n        \n        boolean[] dp = new boolean[s.length()];\n        if (s.charAt(0) == \'1\') {\n            return false;\n        }\n        dp[0] = true;\n        Queue<Integer> q = new LinkedList<>();             //to sore only useful index for calculation of minJump and maxJump\n        q.add(0);\n        for (int i = 1; i < s.length(); i++) {\n            if (s.charAt(i) == \'0\') {\n                boolean done = true;\n                   while (!q.isEmpty() && done) {\n                       int minIndex = q.peek() + n;\n                       int maxIndex = q.peek() + m;\n                        if (i >= minIndex && i <= maxIndex) {\n                            dp[i] =true;\n                            q.add(i);\n                            done = false;\n                        } else if (minIndex > i) {\n                            done = false;\n                        } \n                       else {\n                            q.poll();\n                        }\n                    }\n            }\n        }\n        return dp[s.length() - 1];\n    }\n```
['Queue', 'Java']