diff --git a/Week03/pyramid_roca_ozdaman.py b/Week03/pyramid_roca_ozdaman.py new file mode 100644 index 00000000..81a308eb --- /dev/null +++ b/Week03/pyramid_roca_ozdaman.py @@ -0,0 +1,5 @@ +def calculate_pyramid_height(n): + h = 0 + while (h + 1) * (h + 2) // 2 <= n: + h += 1 + return h