def utopianTree(n):
# Write your code here
init_height = 1
for i in range(n):
if (i + 1) % 2:
init_height *= 2
else:
init_height += 1
return init_height
'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글
[HackerRank-python] Beautiful Days at the Movies (0) | 2022.07.25 |
---|---|
[HankerRank-python] Angry Professor (0) | 2022.07.24 |
[HackerRank-python] Designer PDF Viewer (0) | 2022.07.19 |
[HackerRank-python] The Hurdle Race (0) | 2022.07.14 |
[HackerRank-python] Climbing the Leaderboard (0) | 2022.07.11 |