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
- bit manipulation
- 파이썬
- 코딩테스트
- Binary Tree
- simulation
- 구현
- sorting
- Method
- dynamic programming
- Class
- two pointers
- greedy
- SQL
- Matrix
- geometry
- 코테
- Data Structure
- Binary Search
- java
- Tree
- Counting
- hash table
- Math
- Stack
- Number Theory
- array
- string
- 자바
- implement
- database
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 암호 해독 본문
1. Input
1) 문자열 cipher
2) 정수 code
2. Output
1) 해독된 암호
2) cipher에서 code의 배수 번째 글자만 진짜 암호
3. Constraint
1) 1 ≤ cipher의 길이 ≤ 1,000
2) 1 ≤ code ≤ cipher의 길이
3) cipher는 소문자와 공백으로만 구성되어 있다.
4) 공백도 하나의 문자로 취급
4. Example
Input: cipher=“hitcre”, code=2 -> Output: “ice”
설명: 2번째 글자는 i, 4번째 글자는 c, 6번째 글자는 e이므로 이를 합친 “ice”를 반환
5. Code
1) 첫 코드(2022/10/28)
String answer = "";
for(int i=code-1 ; i<cipher.length() ; i+=code)
answer += String.valueOf(cipher.charAt(i));
return answer;
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 영어가 싫어요 (0) | 2022.10.31 |
---|---|
[프로그래머스/Lv.0] 대문자와 소문자 (0) | 2022.10.28 |
[프로그래머스/Lv.0] 369게임 (0) | 2022.10.28 |
[프로그래머스/Lv.0] 가까운 수 (0) | 2022.10.28 |
[프로그래머스/Lv.0] 컨트롤 제트 (0) | 2022.10.28 |