Not possible to convert
if ( str1 [ i ] < str2 [ i ] ) { cout << -1 << endl ; return ; } else if ( str1 [ i ] == str2 [ i ] ) continue ; else { convChar [ str2 [ i ] - ' a ' ] . push_back ( i ) ; convertMap [ i ] = str2 [ i ] ; } }