Skip to content

Commit fcf07ed

Browse files
committed
[level 0] Title: 뒤집힌 문자열, Time: 12.53 ms, Memory: 76.2 MB -BaekjoonHub
1 parent f0729db commit fcf07ed

2 files changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# [level 0] 뒤집힌 문자열 - 120822
2+
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/120822)
4+
5+
### 성능 요약
6+
7+
메모리: 76.2 MB, 시간: 12.53 ms
8+
9+
### 구분
10+
11+
코딩테스트 연습 > 코딩테스트 입문
12+
13+
### 채점결과
14+
15+
정확성: 100.0<br/>합계: 100.0 / 100.0
16+
17+
### 제출 일자
18+
19+
2026년 04월 18일 11:17:50
20+
21+
### 문제 설명
22+
23+
<p>문자열 <code>my_string</code>이 매개변수로 주어집니다. <code>my_string</code>을 거꾸로 뒤집은 문자열을 return하도록 solution 함수를 완성해주세요.</p>
24+
25+
<hr>
26+
27+
<h5>제한사항</h5>
28+
29+
<ul>
30+
<li>1 ≤ <code>my_string</code>의 길이 ≤ 1,000</li>
31+
</ul>
32+
33+
<hr>
34+
35+
<h5>입출력 예</h5>
36+
<table class="table">
37+
<thead><tr>
38+
<th>my_string</th>
39+
<th>return</th>
40+
</tr>
41+
</thead>
42+
<tbody><tr>
43+
<td>"jaron"</td>
44+
<td>"noraj"</td>
45+
</tr>
46+
<tr>
47+
<td>"bread"</td>
48+
<td>"daerb"</td>
49+
</tr>
50+
</tbody>
51+
</table>
52+
<hr>
53+
54+
<h5>입출력 예 설명</h5>
55+
56+
<p>입출력 예 #1</p>
57+
58+
<ul>
59+
<li><code>my_string</code>이 "jaron"이므로 거꾸로 뒤집은 "noraj"를 return합니다.</li>
60+
</ul>
61+
62+
<p>입출력 예 #2</p>
63+
64+
<ul>
65+
<li><code>my_string</code>이 "bread"이므로 거꾸로 뒤집은 "daerb"를 return합니다.</li>
66+
</ul>
67+
68+
69+
> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public String solution(String my_string) {
3+
String answer = "";
4+
5+
for(int i=0; i<my_string.length(); i++ ){
6+
answer += my_string.charAt(my_string.length()-i-1);
7+
}
8+
9+
return answer;
10+
}
11+
}

0 commit comments

Comments
 (0)