Meta Interview Question

easy leet code style problem solved with prefix trees