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
- Number Theory
- Binary Search
- Stack
- two pointers
- sorting
- 구현
- dynamic programming
- Math
- geometry
- implement
- Matrix
- 파이썬
- hash table
- 코딩테스트
- 코테
- database
- 자바
- SQL
- Data Structure
- Tree
- java
- Class
- Binary Tree
- bit manipulation
- string
- array
- simulation
- Method
- Counting
- greedy
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] qr code 본문
1. Input, Output, Example
- code의 각 인덱스를 q로 나누었을 때 나머지가 r인 위치의 문자를 앞에서부터 순서대로 이어 붙인 문자열을 반환
2. Constraint
1) 0 ≤ r < q ≤ 20
2) r < code의 길이 ≤ 1,000
3) code는 영소문자로만 이루어져 있다.
3. Code
1) 첫 코드(2023/04/27)
class Solution {
public String solution(int q, int r, String code) {
String answer = "";
for(int i=r ; i<code.length() ; i+=q)
answer += code.charAt(i);
return answer;
}
}
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 무작위로 K개의 수 뽑기 (0) | 2023.04.27 |
---|---|
[프로그래머스/Lv.0] 배열 만들기 4 (0) | 2023.04.27 |
[프로그래머스/Lv.0] 왼쪽 오른쪽 (0) | 2023.04.27 |
[프로그래머스/Lv.0] 간단한 식 계산하기 (0) | 2023.04.27 |
[프로그래머스/Lv.0] 배열의 원소만큼 추가하기 (0) | 2023.04.27 |