Function to count the number of ways to partition the String such that each partition have same number of distinct character
static int waysToSplit ( String s ) { int n = s . length ( ) ; int answer = 0 ;