Alien Dictionary

You are given a list of strings from the alien language's dictionary, where the strings in words are sorted lexicographically by the rules of this new language.
Return a string of the unique letters in the new alien language sorted in lexicographically increasing order by the new language's rules. If there is no solution, return "". If there are multiple solutions, return any of them.
Input Format
First line contains one integer N. 
Next line contains n Strings.
Output Format
Return a string of the unique letters in the new alien language sorted in lexicographically increasing order.
Question Video
Constraints
1 <= number of words <= 100
1 <= length of each word <= 100
word consists of only lowercase English letters
Sample Input
5
wrt wrf er ett rftt
Sample Output
wertf


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name