Solution: Verifying an Alien Dictionary

Let's solve the Verifying an Alien Dictionary problem using the Topological Sort pattern.

Statement

You’re given an array of words with lowercase English letters in a different order, written in an alien language. The order of the alphabet is some permutation of lowercase letters of the English language.

We have to return TRUE if the given array of words is sorted lexicographically in this alien language.

Constraints:

  • 11 \leq words.length 103\leq 10^3
  • 11 \leq
...

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.