If none of them is changed in the previous loop then subtract 2 from K and convert both to 9
if ( k >= 2 && palin [ l ] == str [ l ] && palin [ r ] == str [ r ] ) { k -= 2 ; palin [ l ] = palin [ r ] = ' ' ; }