Algorithm/프로그래머스
[프로그래머스] 최솟값 만들기 - 파이썬
potato_pizza
2024. 5. 31. 13:52
728x90
Programmers
최솟값 만들기
https://school.programmers.co.kr/learn/courses/30/lessons/12941
문제
코드
- sort를 활용한 풀이
def solution(A,B):
answer = 0
A.sort(reverse=True)
B.sort()
for i in range(len(A)):
answer += A[i] * B[i]
return answer
728x90
반응형