Ideas: prefix tree to store all the prefix string.
1. The state transition equation:
2. Calculate the order