Removing allocated_elements
else { missing . remove ( arr [ i ] ) ; } } int [ ] mi = new int [ missing . size ( ) ] ; int l = 0 ; for ( int x : missing ) { mi [ l ++ ] = x ; } int m = missing . size ( ) ;