[프로그래머스 | C# | Lv.0] 암호 해독

728x90

https://school.programmers.co.kr/learn/courses/30/lessons/120892

 

📝 나의 풀이

using System;

public class Solution {
    public string solution(string cipher, int code) {
        string answer = "";
        
        char[] tmp = cipher.ToCharArray();
        
        for(int i=code-1; i<cipher.Length; ){
            answer += tmp[i].ToString();
            i+=code;
        }
        return answer;
    }
}
728x90