Skip to content

Commit

Permalink
Merge pull request SnowScriptWinterOfCode#536 from aishwarya-chandra/…
Browse files Browse the repository at this point in the history
…day8q1

day8q1
  • Loading branch information
bh-g authored Jan 23, 2024
2 parents b248bb9 + 13eaf27 commit 6deedcc
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Day-8/q1. First Missing Positive/aishwarya--J.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```
class Solution {
public int firstMissingPositive(int[] nums) {
int n=nums.length;
Arrays.sort(nums);
int sum=1;
for(int i=0;i<n;i++)
{
if(sum==nums[i])
{
sum++;
}
}
return sum;
}
}
```

0 comments on commit 6deedcc

Please sign in to comment.