#-*- coding: UTF-8 -*-
class Solution(object):
def getHint(self, secret, guess):
"""
:type secret: str
:type guess: str
:rtype: str
"""
countA,i,numList=0,-1,[[0,0] for j in range(10)]
print numList
while 1:
i+=1
try:
if secret[i]==guess[i]:countA+=1
else:
numList[int(secret[i])][0]+=1
numList[int(guess[i])][1]+=1
except:
break
return "%sA%sB"%(countA,sum(min(i,v) for i,v in numList))