Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- 구현
- hash table
- Counting
- 코딩테스트
- Method
- geometry
- database
- Matrix
- two pointers
- 파이썬
- implement
- greedy
- 자바
- dynamic programming
- Math
- sorting
- Tree
- Number Theory
- SQL
- 코테
- java
- string
- Binary Tree
- Binary Search
- Data Structure
- array
- bit manipulation
- simulation
- Stack
- Class
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 모음 제거 본문
1. Input
1) 문자열 my_string
2. Output
1) 모음 a, e, i, o, u를 제거한 문자열
3. Constraint
1) my_string은 소문자와 공백으로만 이루어져 있다.
2) 1 ≤ my_string의 길이 ≤ 1,000
4. Example
Input: my_string="nice to meet you" -> Output: "nc t mt y"
5. Code
1) 첫 코드(2022/10/27)
String[] ahdma = {"a","e","i","o","u"};
for(int i=0 ; i<ahdma.length ; i++)
my_string = my_string.replaceAll(ahdma[i],"");
return my_string;
2) 정규표현식을 이용해 간결하게 수정한 코드(2022/10/27)
return my_string.replaceAll(“[aeiou]”,“”);
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 숨어있는 숫자의 덧셈 (1) (0) | 2022.10.27 |
---|---|
[프로그래머스/Lv.0] 문자열 정렬하기 (1) (0) | 2022.10.27 |
[프로그래머스/Lv.0] 팩토리얼 (0) | 2022.10.26 |
[프로그래머스/Lv.0] 최댓값 만들기 (1) (0) | 2022.10.26 |
[프로그래머스/Lv.0] 합성수 찾기 (0) | 2022.10.26 |