LeetCode --- 953. Verifying an Alien Dictionary 解题报告

Posted 杨鑫newlfe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 953. Verifying an Alien Dictionary 解题报告相关的知识,希望对你有一定的参考价值。

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.

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 lexicographicaly in this alien language.

 

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

以上是关于LeetCode --- 953. Verifying an Alien Dictionary 解题报告的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode953

[LeetCode] 953. Verifying an Alien Dictionary

[LeetCode] 953. Verifying an Alien Dictionary

LeetCode --- 953. Verifying an Alien Dictionary 解题报告

LeetCode 953 验证外星词语典[Map] HERODING的LeetCode之路

Leetcode 953. Verifying an Alien Dictionary