Queue || Easy to Understand || Java || Simple
first store the total zero \'0\' that are in the string in queue .. \nThen there is another queue that store where to move in the next jump . \nThen just follow
first store the total zero \'0\' that are in the string in queue .. \nThen there is another queue that store where to move in the next jump . \nThen just follow the instruction given in the qus ..\n\nDry run on the few test Case you will understand the soln \n"000000"\n4\n4\n"01111111011110"\n1\n9\n"00111010"\n3\n5\n\n````\nclass Solution {\n    public boolean canReach(String s, int minJump, int maxJump) {\n        \n        \n        Queue<Integer> q = new LinkedList<>();\n         Queue<Integer> zero = new LinkedList<>();\n        int n = s.length();\n        \n        for(int i=1;i<n;i++){\n            \n            if(s.charAt(i)==\'0\')\n            zero.add(i);\n        }\n        q.add(0);\n        \n        if(s.charAt(0)!=\'0\'){\n            return false;\n        }\n        while(!q.isEmpty()){\n            \n            int ind = q.poll();\n            \n            if(ind==(s.length()-1)){\n                return true;\n            }\n            int jmax = Math.min(ind+maxJump,s.length()-1);\n            int jmin = ind+minJump;\n           \n            if(jmin <=jmax){\n                \n                while(!zero.isEmpty()  && jmax>=zero.peek()){\n                    \n                   int j = zero.poll();\n                   if(jmin<=j){\n                        q.add(j);\n                   }\n                }\n           \n            }\n        }\n        return false;\n    }\n}\n````
['Queue', 'Java']