[Programmers] 숫자 짝꿍
Python
def solution(X, Y):
answer = ""
for i in range(9,-1,-1) :
answer += (str(i) * min(X.count(str(i)), Y.count(str(i))))
if not answer:
answer = "-1"
elif answer[0] == "0":
answer = "0"
return answer
댓글남기기