Implement a function to find the first character in a string which only appears once. For example: It returns ‘D’ when the input is “AamolDGoteAamolGote”. Typical solution for this problem may be scanning the input string from its beginning to end. We compare the current scanned character with every one behind it. If there is no duplication after it, it is a character appearing once. Since it compares each character with O(n) ones behind it, the overall time complexity is O(n2) if there are n characters in a string. Instead of doing this we can follow the approach using Hash tables, we can implement a hash table, in which keys are characters and values are their occurrence times in a string. It is necessary to scan strings twice: When a character is visited, we increase the corresponding occurrence time in the hash table during the first scanning. In second round of scanning, whenever a character is visited we also check its occurrence time in the hash table. The first character with occurrence time 1 is the required output.