728x90
반응형
class Solution {
public String solution(String cipher, int code) {
StringBuilder sb = new StringBuilder();
for(int i=code-1; i<cipher.length(); i+=code){
sb.append(cipher.charAt(i));
}
return sb.toString();
}
}
728x90
반응형
'알고리즘 문제풀이 > Programmers - 자바' 카테고리의 다른 글
프로그래머스 - 문자열 정렬하기 (1) (0) | 2023.03.04 |
---|---|
프로그래머스 - 대문자와 소문자 (0) | 2023.03.04 |
프로그래머스 - 가위 바위 보 (0) | 2023.03.03 |
프로그래머스 - 제곱수 판별하기 (0) | 2023.03.03 |
프로그래머스 - 개미 군단 (0) | 2023.03.03 |