Search⌘ K

DIY: Alien Dictionary

Explore how to analyze a list of alien language words sorted lexicographically to infer the unique alphabetical order. Learn to implement the alienOrder function that returns letters sorted by the alien dictionary rules or an empty string if no valid order exists.

Problem statement

In this coding exercise, you are given a list of words written in an alien language, where the strings in 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. ...