Skip to content

Commit 46d2044

Browse files
committed
[level 1] Title: 문자열 내림차순으로 배치하기, Time: 0.41 ms, Memory: 65 MB -BaekjoonHub
1 parent b3bcd11 commit 46d2044

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

프로그래머스/1/12917. 문자열 내림차순으로 배치하기/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### 성능 요약
66

7-
메모리: 75.3 MB, 시간: 0.39 ms
7+
메모리: 65 MB, 시간: 0.41 ms
88

99
### 구분
1010

@@ -16,7 +16,7 @@
1616

1717
### 제출 일자
1818

19-
2026년 05월 09일 00:46:37
19+
2026년 06월 22일 20:53:22
2020

2121
### 문제 설명
2222

프로그래머스/1/12917. 문자열 내림차순으로 배치하기/문자열 내림차순으로 배치하기.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22

33
class Solution {
44
public String solution(String s) {
5-
// string -> array
65
char[] arr = s.toCharArray();
7-
8-
// sort
96
Arrays.sort(arr);
10-
11-
String data = new String(arr);
12-
// StringBuilder().reverse().toString()
13-
14-
return new StringBuilder(data).reverse().toString();
7+
return new StringBuilder(String.valueOf(arr)).reverse().toString();
158

169
}
1710
}

0 commit comments

Comments
 (0)