1. If the data of each node comes from a fixed character set like ASCII, we can create a array to store whether the character appear in the string. Thus, runtime is O(n), space is O(size of character set). If we don't know the range of data, we can use hashtable.
2. If the space must be O(1), we can search each character in the string, runtime time is O(n^2).