def solution(a, b, c, d) : origin = [a,b,c,d] so = list(set(origin)) if len(so) == 1 : # 4개 전부 같을 때 return origin[0] * 1111 elif len(so) == 2 : # 3개가 같거나, 2개/2개 같을 때 for i in origin : if origin.count(i) == 3 : p = i q = [x for x in origin if x != p][0] return (10 * p + q) ** 2 elif origin.count(i) == 2 : p = i q = [x for x in origin if x != p][0] return (p + q) * abs(p - q) elif len(so) == 3 : #..