# n으로 나눠주는 이유는 [5, 4, 3]인 경우를 생각
def saveThePrisoner(n, m, s):
# Write your code here
result = (m - 1 + s) % n
return n if not result else result
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Sequence Equation (0) | 2022.07.28 |
---|---|
[HackerRank-python] Circular Array Rotation (0) | 2022.07.27 |
[HackerRank-python] Viral Advertising (0) | 2022.07.26 |
[HackerRank-python] Beautiful Days at the Movies (0) | 2022.07.25 |
[HankerRank-python] Angry Professor (0) | 2022.07.24 |