Skip to content

Commit

Permalink
day8q1
Browse files Browse the repository at this point in the history
  • Loading branch information
aishwarya-chandra committed Jan 23, 2024
1 parent 5fb5870 commit 13eaf27
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 13eaf27

Please sign in to comment.