Solving Verifying an Alien Dictionary in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Example 1:

Input: words = ["hello","leetcode"], order = "hlabcdefgijkmnopqrstuvwxyz"
Output: true
Explanation: As 'h' comes before 'l' in this language, then the sequence is sorted.

Example 2:

Input: words = ["word","world","row"], order = "worldabcefghijkmnpqstuvxyz"
Output: false
Explanation: As 'd' comes after 'l' in this language, then words[0] > words[1], hence the sequence is unsorted.

Example 3:

Input: words = ["apple","app"], order = "abcdefghijklmnopqrstuvwxyz"
Output: false


  1. 1 <= words.length <= 100
  2. 1 <= words[i].length <= 20
  3. order.length == 26

See the full details of the problem Verifying an Alien Dictionary at LeetCode

Originally posted at: