Kikoff interview question

Alien dictionary problem from leetcode