Skip to content

Commit 69ee01d

Browse files
authored
Create pyramid_burakhan_gultoplar.py
1 parent 71f5b39 commit 69ee01d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
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):
2+
height = 0
3+
required_block = 1
4+
5+
while number_of_blocks >= required_block:
6+
number_of_blocks -= required_block
7+
height += 1
8+
required_block += 1
9+
10+
return height

0 commit comments

Comments
 (0)