private boolean wordBreakRecursive(String s, Set<String> dict) {
            Map<Character, List<String>> indexWords = new HashMap<Character, List<String>>();
            for (String word : dict) {
                if (!word.equals("")) {
                    Character index = word.charAt(0);
                    List<String> words = indexWords.get(index);
                    if (words == null) {
                        words = new ArrayList<String>();
                        indexWords.put(index, words);
                    }
                    words.add(word);
                    Collections.sort(words, Collections.reverseOrder());
                }
            }

            return wordBreakHelper(s, indexWords);
        }