If pattern matches then print the corresponding mapped words
if ( maps . find ( strr ) != maps . end ( ) ) { vector < string > temp ; temp . insert ( temp . end ( ) , maps [ strr ] . begin ( ) , maps [ strr ] . end ( ) ) ; temp . push_back ( arr [ wordPos ] ) ; maps [ strr ] = temp ; } else { vector < string > vec = { arr [ wordPos ] } ; maps [ strr ] = vec ; } }