Case 1 when K > d In first step , modify all the character which are not same in S1 and S3
for ( int i = 0 ; i < s1 . size ( ) ; i ++ ) { if ( s1 [ i ] != s3 [ i ] ) { for ( int j = 0 ; j < 3 ; j ++ ) {