human
Rearrange an array such that ' arr [ j ] ' becomes ' i ' if ' arr [ i ] ' is ' j ' | Set 1 | A simple method to rearrange arr [ 0. . n - 1 ] ' ▁ so ▁ that ▁ ' arr [ j ] ' ▁ becomes ▁ ' i ' ▁ if ▁ ' arr [ i ] ' ▁ is ▁ ' j.
Create an auxiliary array of same size.
Store result in temp [ ].
Copy temp back to arr [ ].
A utility function to print contents of arr [ 0. . n - 1 ].
Driver program"
Solution in Python:

=====
Write me a code to rearrange an array such that ' arr [ j ] ' becomes ' i ' if ' arr [ i ] ' is ' j ' and the other steps required?
assistant
#Here is code to rearrange an array such that ' arr [ j ] ' becomes ' i ' if ' arr [ i ] ' is ' j ' and the other steps required.
 def rearrangeNaive ( arr , n ) :
	temp = [ 0 ] * n
	for i in range ( 0 , n ) :
		temp [ arr [ i ] ] = i
	for i in range ( 0 , n ) :
		arr [ i ] = temp [ i ]
def printArray ( arr , n ) :
	for i in range ( 0 , n ) :
		print ( arr [ i ] , end = " ▁ " )
arr = [ 1 , 3 , 0 , 2 ]
n = len ( arr )
print ( " Given ▁ array ▁ is " , end = " ▁ " )
printArray ( arr , n )
rearrangeNaive ( arr , n )
print ( " Modified array is " , ▁ end ▁ = ▁ "   " )
printArray ( arr , n )