diff --git a/Week03/pyramid_berra_soyler.py b/Week03/pyramid_berra_soyler.py new file mode 100644 index 00000000..ac3196a2 --- /dev/null +++ b/Week03/pyramid_berra_soyler.py @@ -0,0 +1,9 @@ +def calculate_pyramid_height(blocks): + height = 0 + total_blocks = 0 + + while total_blocks + (height + 1) <= blocks: + height += 1 + total_blocks += height + + return height