Skip to content

Commit 2001bbf

Browse files
authored
Merge pull request #1550 from AlgorithmWithGod/lkhyun
[20251130] PGM / Lv2 / 최솟값 만들기 / 이강현
2 parents a865ef4 + 0480cb9 commit 2001bbf

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
```java
2+
import java.util.*;
3+
class Solution
4+
{
5+
public int solution(int []A, int []B)
6+
{
7+
int answer = 0;
8+
9+
Arrays.sort(A);
10+
Arrays.sort(B);
11+
12+
int Aidx = 0;
13+
int Bidx = B.length-1;
14+
15+
for(int i = 0; i<A.length; i++){
16+
answer += (A[Aidx++]*B[Bidx--]);
17+
}
18+
19+
return answer;
20+
}
21+
}
22+
```

0 commit comments

Comments
 (0)