https://www.hackerrank.com/challenges/strange-code/problem?isFullScreen=true
def strangeCounter(t):
# Write your code here
n_start = 3
n = 3
n_last = 0 #전에 n값을 저장
while t > n:
n_last = n
a = n*2
n = a + n_start
length = n - n_last
return length - (t-n_last) +1
'파이썬 코딩테스트 > 해커랭크' 카테고리의 다른 글
HackerRank / Drawing Books / Python (0) | 2022.01.05 |
---|---|
HackerRank / Append and Delete / Python (0) | 2022.01.05 |
HackerRank / Games of Thrones - 1 / Python (0) | 2022.01.02 |
HackerRank / Two Strings / Python (0) | 2022.01.02 |
HackerRank / Anagram / Python (0) | 2021.12.31 |