if patt [ i ] is found in ' um ' , check if it has the minimum index or not accordingly update ' minIndex '
if ( um . find ( patt [ i ] ) != um . end ( ) && um [ patt [ i ] ] < minIndex ) minIndex = um [ patt [ i ] ] ;