diff --git "a/Week03/pyramid_mert_do\304\237an_ayg\303\274n.py" "b/Week03/pyramid_mert_do\304\237an_ayg\303\274n.py" new file mode 100644 index 00000000..c0a7183e --- /dev/null +++ "b/Week03/pyramid_mert_do\304\237an_ayg\303\274n.py" @@ -0,0 +1,8 @@ +def find_pyramid_height(total_blocks): + current_height = 0 + for _ in range(total_blocks): + current_height += 1 + if current_height * (current_height + 1) // 2 > total_blocks: + current_height -= 1 + break + return current_height