Verifying an Alien Dictionary Problem
Verifying an Alien Dictionary Problem — ExecCode Easy DSA Practice
Solve the Verifying an Alien Dictionary problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given a sequence of words written in the alien language, and the order of the alphabet, return true if and only if the given words are sorted lexicographically in this alien language. Your task is to in an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters. Return the required answer exactly as shown in the examples.
Examples
Input {"words": ["hello", "leetcode"], "order": "hlabcdefgijkmnopqrstuvwxyz"}; Output True. Input {"words": ["word", "world", "row"], "order": "worldabcefghijkmnpqstuvxyz"}; Output False
Constraints
1 <= words.length <= 100 1 <= words[i].length <= 20 order.length == 26 All characters in words[i] and order are English lowercase letters.
Practice Verifying an Alien Dictionary free on ExecCode. Browse DSA problems, topic map, and placement guides.