Amazon interview question

the Alien Dictionary leetcode problem