private int help(String s, int idx, NestedInteger curr) {
	        int l = idx+1, r = idx+1;
	        while (r < s.length()) {
	            char ch = s.charAt(r);
	            if (ch == '[') {
	                NestedInteger next = new NestedInteger();
	                r = help(s, l, next);
	                curr.add(next);
	            } else if (ch == ']') {
	                if (l != r) {
	                    curr.add(new NestedInteger(Integer.valueOf(s.substring(l, r))));
	                    break;
	                }
	            } else if (ch == ',') {
	                if (l != r) {
	                    curr.add(new NestedInteger(Integer.valueOf(s.substring(l, r))));
	                }
	            }
	            if (ch == '[' || ch == ']' || ch == ',')
	                l = r + 1;
	            r++;
	        }
	        
	        return r;
	    }