Skip to content

Commit 626ec22

Browse files
authored
Create pyramid_roca_ozdaman.py
1 parent 71f5b39 commit 626ec22

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Week03/pyramid_roca_ozdaman.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def calculate_pyramid_height(n):
2+
h = 0
3+
while (h + 1) * (h + 2) // 2 <= n:
4+
h += 1
5+
return h

0 commit comments

Comments
 (0)