Neoalgo: First Missing Positive Number

Created on 29 Aug 2020  路  11Comments  路  Source: TesseractCoding/NeoAlgo

馃殌 Feature

Given an array of integers, find the first missing positive integer in linear time and constant space. In other words,
find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well.

For example, the input [3, 4, -1, 1] should give 2. The input [1, 2, 0] should give 3.

You can modify the input array in-place.

Have you read the Contributing Guidelines on Pull Requests?

Yes

Motivation

This problem helps to understand how to work with arrays "in-place" .

Pitch

This problem expects solution in Linear time (O(n)) and constant space (O(1)) which poses a challenge to come up with optimal solution. This makes this problem interesting!

Happy Coding!

Programming Language Assigned

  • CPP - @smv1999
  • Python - @devanshi-katyal
  • C - @SangeetaMishra
  • Java - @ritvij14
C C-Plus-Plus CH20 Java Python easy no-issue-activity

Most helpful comment

@SKAUL05 @Abhijit2505 @HarshCasper I want to work on this issue in CPP! Kindly assign me this issue!

All 11 comments

@SKAUL05 @Abhijit2505 @HarshCasper I want to work on this issue in CPP! Kindly assign me this issue!

i would like to work on this issue in python

I would like to work in C.

I would like to take this in Java. for CH20

@smv1999 , please get started with the solution in CPP

@devanshi-katyal , get started with the solution in Python

@SangeetaMishra , please get started with the solution in C.

@ritvij14 please get started with the solution in Java

@SangeetaMishra , please get started with the solution in C.

Solve it in C. #882 @Abhijit2505 @SKAUL05 @siddharth25pandey @iamrajiv

We are logging the scores for the Contributor's Hack 2020. If you have one or more than one PR merged during the program, make sure to fill this form

Please reopen this issue once you add more information and updates here. If this is not the case and you need some help, feel free to seek help from our Telegram or ping one of the reviewers. Thank you for your contributions!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TEJASWI-TEJASWI picture TEJASWI-TEJASWI  路  7Comments

sahanabalappa picture sahanabalappa  路  8Comments

sharur7 picture sharur7  路  9Comments

SayaniG371 picture SayaniG371  路  9Comments

HarshCasper picture HarshCasper  路  9Comments