human
Find all numbers in range [ 1 , N ] that are not present in given Array | Function to find the missing numbers.
Traverse the array arr [ ].
Update.
Traverse the array arr [ ].
If Num is not present.
Given Input.
Function Call"
How can the above be solved in Python?
assistant
#Here is code to find all numbers in range [ 1 , N ] that are not present in given Array and the other steps required.
 def getMissingNumbers ( arr ) :
	for num in arr :
		arr [ abs ( num ) - 1 ] = - ( abs ( arr [ abs ( num ) - 1 ] ) )
	for pos , num in enumerate ( arr ) :
		if num > 0 :
			print ( pos + 1 , end = ' ▁ ' )
arr = [ 5 , 5 , 4 , 4 , 2 ]
getMissingNumbers ( arr )