private boolean hitAll(String S, int index, HashMap<String, Integer> allWords, int step) {

        HashMap<String, Integer> left = new HashMap<String, Integer>(allWords);

        while (left.size() > 0) {
            if (hitOne(S, index, left, step)) {
                index += step;
            } else {
                return false;
            }
        }
        return true;
    }