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
- array
- Counting
- Matrix
- java
- Tree
- Stack
- Number Theory
- SQL
- 코딩테스트
- Data Structure
- greedy
- simulation
- bit manipulation
- Binary Search
- hash table
- database
- dynamic programming
- Math
- Class
- Method
- 구현
- string
- geometry
- two pointers
- implement
- Binary Tree
- 파이썬
- 코테
- sorting
- 자바
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.1] 핸드폰 번호 가리기 본문
1. Input
1) 문자열로 저장된 전화번호 phone_number
2. Output
1) 전화번호의 뒷 4자리를 제외한 나머지 숫자를 전부 *으로 가린 문자열
3. Constraint
1) phone_number의 길이는 4 이상 20이하
4. Example
Input: phone_number=“01033334444” -> Output: “*******4444”
5. Code
1) 첫 코드(2022/??)
char[] answer = phone_number.toCharArray();
for(int i=0 ; i<answer.length-4 ; i++)
answer[i] = '*';
return String.valueOf(answer);
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.1] 평균 구하기 (0) | 2022.11.23 |
---|---|
[프로그래머스/Lv.1] 하샤드 수 (0) | 2022.11.23 |
[프로그래머스/Lv.1] 행렬의 덧셈 (0) | 2022.11.22 |
[프로그래머스/Lv.1] x만큼 간격이 있는 n개의 숫자 (0) | 2022.11.22 |
[프로그래머스/Lv.1] 직사각형 별찍기 (0) | 2022.11.22 |