Meta·Software Engineer·Technical Phone Screen
- Given a custom alphabet ordering and a list of strings, determine whether the strings are sorted in nondecreasing lexicographic order according to that alphabet.
- Given a list of strings already sorted under some unknown custom alphabet, infer a valid alphabet ordering consistent with that list. Return any one valid ordering, or indicate it's impossible if none exists.
“Not too bad once you map each character to its position index and compare adjacent words character by character.”