Inserting array elements in mp
for ( int i = 0 ; i < n ; i ++ ) mp . insert ( { a [ i ] , i } ) ; for ( int i = 0 ; i < m ; i ++ ) mp . insert ( { b [ i ] , i } ) ; cout << " The ▁ union ▁ set ▁ of ▁ both ▁ arrays ▁ is ▁ : " << endl ; for ( auto itr = mp . begin ( ) ; itr != mp . end ( ) ; itr ++ ) cout << itr -> first << " ▁ " ; }