[프로그래머스]암호 해독

박예림·2023년 3월 7일
0

코테

목록 보기
44/132

class Solution {
    public String solution(String cipher, int code) {
        String answer = "";
        String[] str = cipher.split("");
        
        for (int i = 0; i < str.length; i++) {
            if((i+1)%code==0){
                answer += str[i];
            }
        }
        return answer;
    }
}
profile
응애 나 아기개발자

0개의 댓글