Skip to content

Commit 55df41c

Browse files
committed
[level 0] Title: 모음 제거, Time: 9.49 ms, Memory: 76 MB -BaekjoonHub
1 parent 990430a commit 55df41c

2 files changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# [level 0] 모음 제거 - 120849
2+
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/120849)
4+
5+
### 성능 요약
6+
7+
메모리: 76 MB, 시간: 9.49 ms
8+
9+
### 구분
10+
11+
코딩테스트 연습 > 코딩테스트 입문
12+
13+
### 채점결과
14+
15+
정확성: 100.0<br/>합계: 100.0 / 100.0
16+
17+
### 제출 일자
18+
19+
2026년 05월 07일 17:02:45
20+
21+
### 문제 설명
22+
23+
<p>영어에선 a, e, i, o, u 다섯 가지 알파벳을 모음으로 분류합니다. 문자열 <code>my_string</code>이 매개변수로 주어질 때 모음을 제거한 문자열을 return하도록 solution 함수를 완성해주세요.</p>
24+
25+
<hr>
26+
27+
<h5>제한사항</h5>
28+
29+
<ul>
30+
<li><code>my_string</code>은 소문자와 공백으로 이루어져 있습니다.</li>
31+
<li>1 ≤ <code>my_string</code>의 길이 ≤ 1,000</li>
32+
</ul>
33+
34+
<hr>
35+
36+
<h5>입출력 예</h5>
37+
<table class="table">
38+
<thead><tr>
39+
<th>my_string</th>
40+
<th>result</th>
41+
</tr>
42+
</thead>
43+
<tbody><tr>
44+
<td>"bus"</td>
45+
<td>"bs"</td>
46+
</tr>
47+
<tr>
48+
<td>"nice to meet you"</td>
49+
<td>"nc t mt y"</td>
50+
</tr>
51+
</tbody>
52+
</table>
53+
<hr>
54+
55+
<h5>입출력 예 설명</h5>
56+
57+
<p>입출력 예 #1</p>
58+
59+
<ul>
60+
<li>"bus"에서 모음 u를 제거한 "bs"를 return합니다.</li>
61+
</ul>
62+
63+
<p>입출력 예 #1</p>
64+
65+
<ul>
66+
<li>"nice to meet you"에서 모음 i, o, e, u를 모두 제거한 "nc t mt y"를 return합니다.</li>
67+
</ul>
68+
69+
70+
> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
char c = my_string.charAt(i);
7+
8+
if(c == 'a' || c == 'e' ||
9+
c== 'i' || c == 'o' || c == 'u'){
10+
continue;
11+
}
12+
else answer += c;
13+
}
14+
15+
return answer;
16+
}
17+
}

0 commit comments

Comments
 (0)