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

0

[문제링크 - 프로그래머스 - 암호 해독] https://school.programmers.co.kr/learn/courses/30/lessons/120892

class Solution {
    public String solution(String cipher, int code) {
        String answer = "";
        for(int i=code-1 ;i<cipher.length(); i+=code){
            answer += cipher.charAt(i);
        }
        return answer;
    }
}
profile
초심 잃지 않기

0개의 댓글

관련 채용 정보