human
Ways to split string such that each partition starts with distinct character | Returns the number of we can split the string.
Finding the frequency of each character ..
making frequency of first character of string equal to 1..
Finding the product of frequency of occurrence of each character ..
Driver Code"
How can the above be solved in Python?

Write me a code to ways to split string such that each partition starts with distinct character and the other steps required?
assistant
#Here is code to ways to split string such that each partition starts with distinct character and the other steps required.
 def countWays ( s ) :
	count = [ 0 ] * 26 ;
	for x in s :
		count [ ord ( x ) - ord ( ' a ' ) ] = ( count [ ord ( x ) - ord ( ' a ' ) ] ) + 1 ;
	count [ ord ( s [ 0 ] ) - ord ( ' a ' ) ] = 1 ;
	ans = 1 ;
	for i in range ( 26 ) :
		if ( count [ i ] != 0 ) :
			ans *= count [ i ] ;
	return ans ;
if __name__ == ' _ _ main _ _ ' :
	s = " acbbcc " ;
	print ( countWays ( s ) ) ;