Amazon Interview Question

find the first unrepeated character in a string

Interview Answer

Anonymous

Feb 4, 2013

We can use a LinkedHashMap which preserves the order of insertion. After one full scan and storing the counts (if need be), the first item in the hash map with frequency 1 will be the first unrepeated character