human
Distinct state codes that appear in a string as contiguous sub | Function to return the count of distinct state codes.
Insert every sub - string of length 2 in the set.
Return the size of the set.
Driver code"
Solution in Python:
assistant
#Here is code to distinct state codes that appear in a string as contiguous sub and the other steps required.
 def countDistinctCode ( string ) :
	codes = set ( )
	for i in range ( 0 , len ( string ) - 1 ) :
		codes . add ( string [ i : i + 2 ] )
	return len ( codes )
if __name__ == " _ _ main _ _ " :
	string = " UPUP "
	print ( countDistinctCode ( string ) )