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 ) ) ; } }