Traverse the input array and mark visited elements either by marking them as negative in arr [ ] or in helper [ ] .
for i in range ( 0 , len ( arr ) ) : NEW_LINE INDENT temp = abs ( arr [ i ] ) NEW_LINE DEDENT