Use trie to search the longest concatenation from a long list.