Skip to content

Commit 10be0fa

Browse files
committed
Update and rename firstMissingPositive.cpp to first-missing-positive.cpp
1 parent 12ffbf0 commit 10be0fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/firstMissingPositive.cpp renamed to C++/first-missing-positive.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
class Solution {
55
public:
66
int firstMissingPositive(vector<int>& nums) {
7-
int i;
7+
int i = 0;
88
bucketSort(&nums);
9-
for (i = 0; i < nums.size() && nums[i] == i + 1; ++i);
9+
for (; i < nums.size() && nums[i] == i + 1; ++i);
1010
return i + 1;
1111
}
1212

0 commit comments

Comments
 (0)