# Find All Numbers Disappeared in an Array

`Input: nums = [4,3,2,7,8,2,3,1]Output: [5,6]`
`Input: nums = [1,1]Output: [2]`
• `n == nums.length`
• `1 <= n <= 105`
• `1 <= nums[i] <= n`
`class Solution:    def findDisappearedNumbers(self, nums):        result=[]        n=len(nums)        for i in range(1,n+1):               found=False               for j in nums:                  if i==j:                    found=True                    break               if(not found):                  result.append(i)                        return li`
`class Solution:    def findDisappearedNumbers(self, nums: List[int]) -> List[int]:        li=[]        for i in range(len(nums)):            temp=nums[i]-1            if(temp>=0):                while(nums[temp]>0):                    val=nums[temp]-1                    nums[temp]=0                    temp=val        for i in range(len(nums)):            if(nums[i]!=0):                li.append(i+1)                        return li`
`    def findDisappearedNumbers(self, nums: List[int]) -> List[int]:        result=[]                for i in nums:            index=abs(i)-1            nums[index]= -1*abs(nums[index])        for i in range(len(nums)):            if(nums[i]>0):                result.append(i+1)        return result`

--

--

--

## More from Dhanarajappu

Tech-Enthusiast, Coder,Explorer,Geeky,Software Engineer |A piece of code delivers everything that you need. The world is all about codes.

Love podcasts or audiobooks? Learn on the go with our new app.

## Dhanarajappu

Tech-Enthusiast, Coder,Explorer,Geeky,Software Engineer |A piece of code delivers everything that you need. The world is all about codes.