Doubt in the video

I am not able get the explanation of this question algo…
Just telling the steps ,not the reason behind the algo like kartik bhaiya and others did in earlier video …
please explain or add some other content on this…

hello @Adhyayan
here in this problem we have to report first positive number which is missing.
so one thing that is very clear is that to answer this problem we only need to bother about positive integer right?
that why we are assingning some very big positive number at the places of negative numbers( or you ignore them).

now the problem breaks into
we have some positive integers and we have to find first missing positive integer. in o(1) space.
so the idea is to use the given array as hash (ie to checj whether an element is present or not).

how ?
let say we enconter number 3 at some index.
so what we will do is we will go to index 3 , and whatever value present at index we will mark it as negative (this negative sign is indicator that 3 is present in array).

now we will again iterator that array and if at any index we will find any positive value (that means no such value is present with value equal to index is present)
so we will consider this index as answer

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.