Skip to content

Commit

Permalink
Time: 250 ms (5.08%) | Memory: 20.4 MB (30.86%) - LeetSync
Browse files Browse the repository at this point in the history
Dimple-01 committed Jun 12, 2024
1 parent 08f9bf0 commit c2aacb4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions 268-missing-number/missing-number.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Solution {
public:
int missingNumber(vector<int>& nums) {
int len= nums.size();
for(int i=0;i<=len;i++)
{
if( find(nums.begin() , nums.end(), i) == nums.end())
{
return i;
}

}
return -1;
}
};

0 comments on commit c2aacb4

Please sign in to comment.