Convert array by taking positions from umap
for i in range ( n ) : NEW_LINE INDENT arr [ i ] = umap [ arr [ i ] ] NEW_LINE DEDENT def printArr ( arr , n ) : NEW_LINE for i in range ( n ) : NEW_LINE INDENT print ( arr [ i ] , end = " ▁ " ) NEW_LINE DEDENT