Bloomberg | Phone Screening | Sort a list of words using a special alphabet
Anonymous User
7217

Given a special alphabet (alien dictionary?) sort a list of words in ascedning order alphabetically:

alphabet: "a", "b", "c", "ch", "d", "dd", "e", "f", "ff", "g", "ng", "h", "i", "l", "ll", "m", "n", "o", "p", "ph", "r", "rh", "s", "t", "th", "u", "w", "y"

Input: "dd r",  "n a h", "d e a", "dd", "ng a h"

Output: "dea", "dd", "ddr", "ngah", "nah"

Not sure if a similar question exists in LC, if so please let me know

Comments (22)