Meta interview question

Word pattern matching using tries