diff --git a/Week03/emir_karaduman_pyramid b/Week03/emir_karaduman_pyramid new file mode 100644 index 00000000..08d4cd3d --- /dev/null +++ b/Week03/emir_karaduman_pyramid @@ -0,0 +1,7 @@ +def calculate_pyramid_height(number_of_blocks: int) -> int: + height = 0 + used_blocks = 0 + while used_blocks + (height + 1) <= number_of_blocks: + height += 1 + used_blocks += height + return height