message: Update first-unique-character-in-a-string.py
diff: # s = "loveleetcode",
  # return 2.
  # Note: You may assume the string contain only lowercase letters.
  -import collections
  -import string
  +from collections import defaultdict
  +
  class Solution(object):
  def firstUniqChar(self, s):
  """
  :type s: str
  :rtype: int
  """
  - lookup = collections.defaultdict(int)
  + lookup = defaultdict(int)
  candidtates = set()
  for i, c in enumerate(s):
  if lookup[c]:
  @@ -32,24 +32,3 @@ class Solution(object):
  candidtates.add(i+1)
  return min(candidtates)-1 if candidtates else -1
  -
  - def firstUniqChar2(self, s):
  - """
  - :type s: str
  - :rtype: int
  - """
  - return min([s.find(c) for c in string.ascii_lowercase if s.count(c) == 1] or [-1])
  -
  - def firstUniqChar3(self, s):
  - """
  - :type s: str
  - :rtype: int
  - """
  - cnt = collections.Counter(s)
  - if cnt:
  - for i in cnt.keys():
  - if cnt[i] == 1:
  - return s.index(i)
  - return -1
  - else:
  - return -1
  