Skip to content

Commit 92a14a0

Browse files
authored
Update minimum-garden-perimeter-to-collect-enough-apples.cpp
1 parent 3a61af8 commit 92a14a0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

C++/minimum-garden-perimeter-to-collect-enough-apples.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ class Solution2 {
6262

6363
int64_t x = pow(2 * neededApples, 1.0 / 3);
6464
x -= x % 2;
65-
assert((x - 2) * (x - 1) * x < 2 * neededApples);
66-
assert(pow(x + 2, 3) >= 2 * neededApples);
65+
assert((x - 2) * (x - 1) * x < 2 * neededApples && 2 * neededApples < pow(x + 2, 3));
6766
x += 2;
6867
if ((x - 2) * (x - 1) * x < 2 * neededApples) {
6968
x += 2;

0 commit comments

Comments
 (0)