← All problems
Alien Dictionary
Derive the character order from a list of words sorted in an alien language.
Complexity
Time O(C), Space O(1) (fixed alphabet)
Common pitfalls
- Missing the prefix-invalid case
- Using only first/last words
Your solution
Log in to save your code and track progress.