Skip to content

Commit 0695bd4

Browse files
Create types_emir_karaduman.py
1 parent 71f5b39 commit 0695bd4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Week03/pyramid_emir_karaduman

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def calculate_pyramid_height(number_of_blocks: int) -> int:
2+
height = 0
3+
used_blocks = 0
4+
5+
while used_blocks + (height + 1) <= number_of_blocks:
6+
height += 1
7+
used_blocks += height
8+
9+
return height
10+

0 commit comments

Comments
 (0)