ji-0630 / CodingTest

코딩테스트 연습 기록
0 stars 0 forks source link

암호해독 #142

Closed ji-0630 closed 1 year ago

ji-0630 commented 1 year ago

문제 설명

image image

ji-0630 commented 1 year ago

나의 풀이

def solution(cipher, code):
    answer = ''
    for i in range(code, len(cipher)+1, code):
        answer += cipher[i-1]
    return answer
ji-0630 commented 1 year ago

다른 사람의 풀이

def solution(cipher, code):
    answer = cipher[code-1::code]
    return answer