Skip to content

Commit 379525f

Browse files
authored
Refactor calculate_pyramid_height function parameters
1 parent 1f99e42 commit 379525f

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
def calculate_pyramid_height(n):
1+
def calculate_pyramid_height(number_of_blocks):
22
height = 0
3-
blocks = 0
4-
5-
while blocks + height + 1 <= n:
3+
while number_of_blocks >= height + 1:
64
height += 1
7-
blocks += height * height
8-
5+
number_of_blocks -= height
96
return height

0 commit comments

Comments
 (0)