human
Maximum String Partition | Return the count of string.
P will store the answer.
Current will store current string Previous will store the previous that has been taken already.
Add a character to current string.
Here we will create a partition and update the previous with current string.
Now we will clear the current string.
Increment the count of partition ..
Driver code"
How can the above be solved in Python?
assistant
#Here is code to maximum String Partition and the other steps required.
 def maxPartition ( s ) :
	n = len ( s )
	P = 0
	current = " "
	previous = " "
	for i in range ( n ) :
		current += s [ i ]
		if ( current != previous ) :
			previous = current
			current = " "
			P += 1
	return P
s = " geeksforgeeks "
ans = maxPartition ( s )
print ( ans )