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 4833179 commit e449bfeCopy full SHA for e449bfe
LiiNi-coder/202511/10 PGM 가장 큰 수.md
@@ -0,0 +1,33 @@
1
+```java
2
+import java.util.*;
3
+
4
+class Solution {
5
+ public String solution(int[] numbers) {
6
+ String[] strs = new String[numbers.length];
7
+ for(int i = 0; i < numbers.length; i++){
8
+ strs[i] = String.valueOf(numbers[i]);
9
+ }
10
11
+ Arrays.sort(strs, new Comparator<String>() {
12
+ @Override
13
+ public int compare(String a, String b) {
14
+ String ab = a + b;
15
+ String ba = b + a;
16
+ return ba.compareTo(ab);
17
18
+ });
19
20
+ if(strs[0].equals("0")){
21
+ return "0";
22
23
24
+ StringBuilder sb = new StringBuilder();
25
+ for(String s : strs){
26
+ sb.append(s);
27
28
29
+ return sb.toString();
30
31
+}
32
33
+```
0 commit comments