solve with marisa_trie for variety