Skip to content

Commit b478175

Browse files
authored
pyramid_muhammet_topcu
1 parent 71f5b39 commit b478175

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Week03/pyramid_muhammet_topcu.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def calculate_pyramid_height(n: int) -> int:
2+
h = 0
3+
used = 0
4+
while used + h + 1 <= n:
5+
h += 1
6+
used += h
7+
return h

0 commit comments

Comments
 (0)