human
Give me a code to find distinct characters in distinct substrings of a string and the other steps required given the following:
Find distinct characters in distinct substrings of a string | Function to return the count of distinct characters in all the distinct sub - strings of the given string.
To store all the sub - strings.
To store the current sub - string.
To store the characters of the current sub - string.
If current sub - string hasn 't  been stored before.
Insert it into the set.
Update the count of distinct characters.
Driver code"
Solution in Python:
assistant
#Here is code to find distinct characters in distinct substrings of a string and the other steps required.
 def countTotalDistinct ( string ) :
	cnt = 0 ;
	items = set ( ) ;
	for i in range ( len ( string ) ) :
		temp = " " ;
		ans = set ( ) ;
		for j in range ( i , len ( string ) ) :
			temp = temp + string [ j ] ;
			ans . add ( string [ j ] ) ;
			if temp not in items :
				items . add ( temp ) ;
				cnt += len ( ans ) ;
	return cnt ;
if __name__ == " _ _ main _ _ " :
	string = " ABCA " ;
	print ( countTotalDistinct ( string ) ) ;