Doubt on leetcode array

My solution-

the question-

Please correct my code and send it to me and tel l me where I am going wrong

Hello @Somasree what is the problem that you are facing?

@Somasree explain me your approach what you are trying to do?

In this probem ,I have assumed that the difference numbers in the array are consequetive natural nos,now since the question asks to print thr + tive missing no hence , I have tried to erase any negative no present and then check whether the diffence between 3 consequetive integers is the 1 or not ,annd hence printed the result

@Somasree it is not sure that the numbers dont have to be in the difference of 1 only.
and also you can simple ignore the negative numbers dont separately remove them.

@Somasree check this approach:

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.