Skip to content

Commit

Permalink
Update minimum-garden-perimeter-to-collect-enough-apples.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 authored Aug 1, 2021
1 parent 44be30b commit 3a61af8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Python/minimum-garden-perimeter-to-collect-enough-apples.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ def minimumPerimeter(self, neededApples):

x = int((2*neededApples)**(1.0/3))
x -= x%2
assert((x-2)*(x-1)*x < 2*neededApples)
assert((x+2)**3 >= 2*neededApples)
assert((x-2)*(x-1)*x < 2*neededApples < (x+2)**3)
x += 2
if (x-2)*(x-1)*x < 2*neededApples:
x += 2
Expand Down

0 comments on commit 3a61af8

Please sign in to comment.