Skip to content

Commit 38326ee

Browse files
committed
[level 1] Title: 자연수 뒤집어 배열로 만들기, Time: 0.10 ms, Memory: 76.2 MB -BaekjoonHub
1 parent e76cac8 commit 38326ee

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

프로그래머스/1/12932. 자연수 뒤집어 배열로 만들기/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# [level 1] 자연수 뒤집어 배열로 만들기 - 12932
22

3-
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/12932)
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/12932?language=java)
44

55
### 성능 요약
66

7-
메모리: 10.4 MB, 시간: 0.02 ms
7+
메모리: 76.2 MB, 시간: 0.10 ms
88

99
### 구분
1010

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

1717
### 제출 일자
1818

19-
2024년 07월 27일 22:01:57
19+
2025년 10월 24일 18:41:34
2020

2121
### 문제 설명
2222

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public int[] solution(long n) {
3+
String str = Long.toString(n);
4+
String reversed = new StringBuilder(str).reverse().toString();
5+
char[] arr = reversed.toCharArray();
6+
7+
int[] result = new int[arr.length];
8+
for(int i=0; i<result.length; i++) {
9+
result[i] = arr[i] - '0';
10+
}
11+
12+
return result;
13+
}
14+
}

0 commit comments

Comments
 (0)