private void getAllChars(String words[], Map<Character, Integer> degree, Set<Character> allCharacters) {
        for (String word : words) {
            for (char ch : word.toCharArray()) {
                allCharacters.add(ch);
                degree.computeIfAbsent(ch, key -> 0);
            }
        }
    }
degree is only used for BFS. Not for DFS.
src/com/interview/graph/AlientDictionary.java