Skip to content

Commit 8575ec7

Browse files
authored
Merge pull request #690 from berriesyl/patch-4
Create pyramid_berra_soyler.py
2 parents ae69807 + cb0c88a commit 8575ec7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Week03/pyramid_berra_soyler.py

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

0 commit comments

Comments
 (0)