可以做LRU cache,还可以用来解决这种题:
Given a string construct a new string containing the occurrences of unique c
haracters in it. You can
assume that only a-z & A-Z appear in the string with 'a' being different fro
m 'A'. Also the letters in the output string must be in the order of their o
ccurrence in the input string.
e.g. for the string "ThunderBirdFirefox" you must return the string "T1h1u1n
1d2e2r3B1i2F1f1o1x1".