message: Update buddy-strings.py
diff: @@ -43,6 +43,11 @@ class Solution(object):
  """
  if len(A) != len(B):
  return False
  - diff = [(a, b) for a, b in itertools.izip(A, B) if a != b]
  + diff = []
  + for a, b in itertools.izip(A, B):
  + if a != b:
  + diff.append((a, b))
  + if len(diff) > 2:
  + return False
  return (not diff and len(set(A)) < len(A)) or \
  (len(diff) == 2 and diff[0] == diff[1][::-1])
  