Skip to content

Commit

Permalink
최소값 만들기 - level2
Browse files Browse the repository at this point in the history
  • Loading branch information
sey2 authored Feb 20, 2023
1 parent 78fe62e commit b268855
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions programmers/MakeMinValue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import java.io.*;
import java.util.*;


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[B.length-1-i];
}


return answer;
}
}

0 comments on commit b268855

Please sign in to comment.