We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a6255d8 commit ae5a4d5Copy full SHA for ae5a4d5
LiiNi-coder/202510/23 PGM 최솟값 만들기.md
@@ -0,0 +1,26 @@
1
+```java
2
+import java.util.*;
3
+
4
+class Solution
5
+{
6
+ public int solution(int []A, int []B)
7
+ {
8
+ int answer = 0;
9
+ List<Integer> a = new ArrayList<>();
10
+ for(int i: A){
11
+ a.add(i);
12
+ }
13
+ List<Integer> b = new ArrayList<>();
14
+ for(int i: B){
15
+ b.add(i);
16
17
+ Collections.sort(a);
18
+ Collections.sort(b, Collections.reverseOrder());
19
+ for(int i = 0; i<A.length; i++)
20
+ answer += a.get(i)*b.get(i);
21
22
23
+ return answer;
24
25
+}
26
+```
0 commit comments