I read of a job interview question to write some code for the following:
Write an efficient function to find the first nonrepeated character in a st
from collections import defaultdict word="googlethis" dici=defaultdict(int) #build up dici with counts of characters for a in word: if dici[a]: dici[a]+=1 for a in word: if didic[a] < 2: return a
wouldn't that work?