================================ 面试题50. 第一个只出现一次的字符 ================================ https://leetcode-cn.com/problems/di-yi-ge-zhi-chu-xian-yi-ci-de-zi-fu-lcof/ .. code:: python class Solution(object): def firstUniqChar(self, s): """ :type s: str :rtype: str """ dic = dict() for c in s: dic[c] = dic.get(c, 0) + 1 for k in s: if dic[k] == 1: return k return ' '