Follow up: What if the inputs contain unicode characters? How would
you adapt your solution to such case?
The first idea strikes me is HashMap, because the size of possible character is large.
I'm not sure if what I think is right.
I use hashmap to implement a VERY SLOW AC solution, it's not really concise and needs to be refined, but I think it may take care of all kinds of Unicode chars......