An alien language uses the same lowercase English letters, but in a different order. Given a list of words written in that language and the string order (a permutation of the 26 letters giving the alien alphabet), return true if and only if the words are sorted lexicographically in the alien language. As in an ordinary dictionary, a word that is a prefix of another comes first, so "app" must come before "apple".
An alien language uses the same lowercase English letters, but in a different order. Given a list of words written in that language and the string order (a permutation of the 26 letters giving the alien alphabet), return true if and only if the words are sorted lexicographically in the alien language. As in an ordinary dictionary, a word that is a prefix of another comes first, so "app" must come before "apple".