diff --git a/Week03/pyramid_muhammet_topcu.py b/Week03/pyramid_muhammet_topcu.py new file mode 100644 index 00000000..71b83d03 --- /dev/null +++ b/Week03/pyramid_muhammet_topcu.py @@ -0,0 +1,7 @@ +def calculate_pyramid_height(n: int) -> int: + h = 0 + used = 0 + while used + h + 1 <= n: + h += 1 + used += h + return h