Check if the substring contains only a single distinct character
if ( isUnique ( sub ) ) mx = Math . Max ( mx , a [ sub . Length - 1 ] + maxScore ( s . Substring ( 0 , i ) + s . Substring ( j + 1 ) , a ) ) ; } }