# -*- coding:utf-8 -*- class Solution: # 返回对应char def __init__(self): self.sdict = {} self.slist = [] def FirstAppearingOnce(self): # write code here if not self.slist: return '#' for i in self.slist: if self.sdict[i] == 1: return i return '#' def Insert(self, char): # write code here self.slist.append(char) for i in char: if i in self.sdict: self.sdict[i] += 1 else: self.sdict[i] = 1