160. Alien Dictionary

Given an array of words words sorted in an alien alphabet order. Recover the order of characters in the alphabet. If the order is contradictory, return an empty string.
Example 1
Input: words = ["z","x","z"]
Output: ""
Explanation: Contradiction in the ordering.
Example 2
Input: words = ["wrt","wrf","er","ett","rftt"]
Output: "wertf"
Explanation: Order of characters in the alien alphabet.
graph
JavaScript
Loading...
Line 1, Char 1