Updating the 2 nd pointer
else { arr [ st ] = arr [ i ] ; st ++ ; } } document . write ( " " ) ; for ( let i = 0 ; i < st ; i ++ ) { document . write ( arr [ i ] ) ; if ( i != st - 1 ) document . write ( " " ) ; } document . write ( " " ) ; }