Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 612 Bytes

README.md

File metadata and controls

22 lines (17 loc) · 612 Bytes

Problem

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, wherewords are sorted lexicographically by the rules of this new language. Derive the order of letters in this language.

For example, Given the following words in dictionary,

[ "wrt", "wrf", "er", "ett", "rftt" ] The correct order is: "wertf".

Note:

You may assume all letters are in lowercase. If the order is invalid, return an empty string. There may be multiple valid order of letters, return any one of them is fine.