Allen Chou says to YSITD
其實就只是 Trie + Lowest Common Ancestor 而已,但就是被我 fuck up 了