private boolean hitOne(String S, int index, HashMap<String, Integer> left, int step) {

        String s = S.substring(index, index + step);
        if (left.containsKey(s)) {
            int count = left.get(s);
            if (count == 1) {
                left.remove(s);
            } else {
                left.put(s, left.get(s) - 1);
            }
            return true;
        }
        return false;

    }