diff --git a/Week03/pyramid_yasin_soytas.py b/Week03/pyramid_yasin_soytas.py new file mode 100644 index 00000000..7dc8bca5 --- /dev/null +++ b/Week03/pyramid_yasin_soytas.py @@ -0,0 +1,9 @@ +def calculate_pyramid_height(number_of_blocks): + height = 0 + used_blocks = 0 + + while used_blocks + (height + 1) <= number_of_blocks: + height += 1 + used_blocks += height + + return height