public String alienOrder(String[] words) {
        Set<Character> allCharacters = new HashSet<>();
        Map<Character, Set<Character>> graph = buildGraph(words, new HashMap<>(), allCharacters);
        Deque<Character> stack = new LinkedList<>();
        Set<Character> visited = new HashSet<>();
        Set<Character> dfs = new HashSet<>();

        for (char ch : allCharacters) {
            if (topSortUtil(ch, stack, visited, dfs, graph)) {
                return "";
            }
        }

        StringBuffer buff = new StringBuffer();
        while (!stack.isEmpty()) {
            buff.append(stack.pollFirst());
        }
        return buff.toString();
    }
There is a new alien language which uses the latin alphabet. However, the order among letters
are unknown to you. You receive a list of words from the dictionary, where words are sorted
lexicographically by the rules of this new language. Derive the order of letters in this language.

https://leetcode.com/problems/alien-dictionary/
src/com/interview/graph/AlientDictionary.java