human
Give me a code to partition the string in two parts such that both parts have at least k different characters and the other steps required given the following:
Partition the string in two parts such that both parts have at least k different characters | Function to find the partition of the string such that both parts have at least k different characters.
Length of the string.
To check if the current character is already found.
Count number of different characters in the left part.
If current character is not already found , increase cnt by 1.
If count becomes equal to k , we 've  got the first part, therefore,  store current index and break the loop.
Increment i by 1.
Clear the map.
Assign cnt as 0.
If the current character is not already found , increase cnt by 1.
If cnt becomes equal to k , the second part also have k different characters so break it.
If the second part has less than k different characters , then print " Not ▁ Possible ".
Otherwise print both parts.
Driver code.
Function call"
Solution in Python:
assistant
#Here is code to partition the string in two parts such that both parts have at least k different characters and the other steps required.
 def division_of_string ( string , k ) :
	n = len ( string ) ;
	has = { } ;
	cnt = 0 ; i = 0 ;
	while ( i < n ) :
		if string [ i ] not in has :
			cnt += 1 ;
			has [ string [ i ] ] = True ;
		if ( cnt == k ) :
			ans = i ;
			break ;
		i += 1 ;
	i += 1 ;
	has . clear ( ) ;
	cnt = 0 ;
	while ( i < n ) :
		if ( string [ i ] not in has ) :
			cnt += 1 ;
			has [ string [ i ] ] = True ;
		if ( cnt == k ) :
			break ;
		i += 1 ;
	if ( cnt < k ) :
		print ( " Not ▁ possible " , end = " " ) ;
	else :
		i = 0 ;
		while ( i <= ans ) :
			print ( string [ i ] , end = " " ) ;
			i += 1 ;
		print ( ) ;
		while ( i < n ) :
			print ( string [ i ] , end = " " ) ;
			i += 1 ;
		print ( )
if __name__ == " _ _ main _ _ " :
	string = " geeksforgeeks " ;
	k = 4 ;
	division_of_string ( string , k ) ;