Alien Dictionary, is a LeetCode problem. In this post we will see how we can solve this challenge in C++

Problem Description

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 non-empty words from the dictionary, where words are sorted lexicographically by the rules of this new language. Derive the order of letters in this language.

Example 1: Given the following words in dictionary,

[ "wrt", "wrf", "er", "ett", "rftt" ] ....

You can find the full details of the problem Alien Dictionary at LeetCode

Solution: Please check the main.cpp snippet for the solution.

This solution originally posted at: Github by @kamyu104