If all types of characters are present . Try combining all pairs .
return ( DP [ a ] [ b ] = min ( length ( a - 1 , b - 1 , c + 1 ) , min ( length ( a - 1 , b + 1 , c - 1 ) , length ( a + 1 , b - 1 , c - 1 ) ) ) ) ; }