Reported interview periodNot available
Words ordered by a custom alphabet
An ordering is supplied as a permutation of the letters. Decide whether the given word list is sorted according to that ordering.
Practice focusRequirements - Line 1 is the word count; that many words follow one per line; the final line is the ordering, a permutation of the twenty-six lowercase letters. - The final line is always the ordering, so the count line only says how many words precede it. - Compare adjacent words left to right and stop at the first position where the letters differ; the letter ranked earlier wins. - If one word is a proper prefix of the other, the shorter word must appear first. - Return true or false in lowercase, with no other text.…