In an alien language, surprisingly they also use english lowercase letters, but possibly in a different
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.
Actually, the idea is pretty straight forward. We have to see the position of each letter in adjant string and to compare. If there exists less or greater, we can return true or false. Otherwise, we go to the next letter. For the optimization, we can use count sort(mapping first) instead of using Java builtin
// time:O(# of words * max(word))