Skip to content

Commit a37ff33

Browse files
authored
Update moving-stones-until-consecutive-ii.cpp
1 parent 7d75351 commit a37ff33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

C++/moving-stones-until-consecutive-ii.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Solution {
55
public:
66
vector<int> numMovesStonesII(vector<int>& stones) {
77
sort(stones.begin(), stones.end());
8-
int left = 0, min_moves = stones.size();
8+
int left = 0, min_moves = numeric_limits<int>::max();
99
int max_moves = max(*stones.crbegin() - stones[1], *next(stones.crbegin(), 1) - stones[0]) -
1010
(stones.size() - 2);
1111
for (int right = 0; right < stones.size(); ++right) {

0 commit comments

Comments
 (0)