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