알고리즘

[프로그래머스] 최솟값 만들기

hminor 2023. 6. 2. 21:27

 

def solution(A,B):
    answer = 0
    A.sort()
    B.sort(reverse=True)
    for i in range(len(A)): answer += A[i]*B[i]
    return answer