uploaded at 2022. 12. 18. 오전 2:35:39

This commit is contained in:
rl544
2022-12-18 02:35:40 +09:00
parent b7c574e878
commit 3e3562fc68
@@ -0,0 +1,16 @@
// [문제 링크]: https://school.programmers.co.kr/learn/courses/30/lessons/12941
import java.util.Arrays;
class Solution
{
public int solution(int []A, int []B)
{
int answer = 0;
Arrays.sort(A);
Arrays.sort(B);
for(int i = 0; i < A.length; i++){
answer += A[i]*B[A.length-i-1];
}
return answer;
}
}