Skip to content

Commit 55da53e

Browse files
authored
Merge pull request #810 from onurkonukk/patch-3
Create pyramid_onur_konuk.py
2 parents aeb2807 + a2f7db9 commit 55da53e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Week03/pyramid_onur_konuk.py

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

0 commit comments

Comments
 (0)