Removing allocated_elements
else { missing . Remove ( arr [ i ] ) ; } } int [ ] mi = new int [ missing . Count ] ; int l = 0 ; foreach ( int x in missing ) { mi [ l ++ ] = x ; } int m = missing . Count ;