Skip to content

Commit f480360

Browse files
authored
Update erect-the-fence.cpp
1 parent d4a4977 commit f480360

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

C++/erect-the-fence.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ class Solution {
3434
}
3535
hull.emplace_back(points[i]);
3636
}
37-
hull.pop_back();
38-
39-
for (int i = 1; i < (hull.size() + 1) / 2; ++i) {
37+
const int cnt = hull.size() / 2;
38+
for (int i = 0; i < cnt; ++i) {
4039
if (hull[i] != hull.back()) {
4140
break;
4241
}

0 commit comments

Comments
 (0)