Alien Dictionary
Explore how to determine the order of letters in an alien language by analyzing a list of alien words. Learn to apply topological sort to find a valid lexicographical order or identify when none exists. This lesson helps you implement a solution in Go, improving your ability to solve complex ordering problems in coding interviews.
We'll cover the following...
Statement
You are given a list of words written in an alien language, where the words are sorted lexicographically by the rules of this language. Surprisingly, the aliens also use English lowercase letters, but possibly in a different order.
Given a list of words written in the alien language, return a string of unique letters sorted in the lexicographical order of the alien language as derived from the list of words.
If there’s no solution, that is, no valid lexicographical ordering, you can return an empty string "".
If multiple valid orderings exist, you may return any of them.
...