Algorithm · Uber · Easy
In this extraterrestrial alphabet, the lowercase English letters follow the sequence specified by order, rather than their usual ordering. Determine whether words is in lexicographic order under that custom alphabet. Return true when it is ordered correctly; otherwise, return false. Examples Example 1: Input: words = ["app","apple"], order = "abcdefghijklmnopqrstuvwxyz" Output: true Explanation: "app" appears before "apple" because it is a prefix of the longer word. Example…
Checking your access…