Given a list of words sorted lexicographically in a foreign language that uses lowercase latin letters in a different order, determine the ordering of the letters in that language.
Rules:
Constraints:
Examples:
// Example 1:
const words1 = ["z", "o"];
console.log(alienOrder(words1));
// Output: "zo"
// Explanation: 'z' comes before 'o' in this language
// Example 2:
const words2 = ["hrn", "hrf", "er", "enn", "rfnn"];
console.log(alienOrder(words2));
// Output: "hernf"
// Explanation:
// hrn vs hrf: n < f
// hrf vs er: h < e
// er vs enn: r < n
// enn vs rfnn: e < r
// One valid order is "hernf"