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