def solution(A, B): answer = 0 # A에서 가장 작은 값 x B에서 가장 큰 값 => 최솟값 for a, b in zip(sorted(A), sorted(B, reverse=True)): answer += a * b return answer