human
Lengths of maximized partitions of a string such that each character of the string appears in one substring | Function to find the length of all partitions oof a string such that each characters occurs in a single substring.
Stores last index of string s.
Find the last position of each letter in the string.
Update the last index.
Iterate the given string.
Get the last index of s [ i ].
Extend the current partition characters last pos.
Increase len of partition.
if the current pos of character equals the min pos then the end of partition.
Store the length.
Print all the partition lengths.
Given string str.
Function call"
Solution in Python:

=====
Give me a code to lengths of maximized partitions of a string such that each character of the string appears in one substring and the other steps required?
assistant
#Here is code to lengths of maximized partitions of a string such that each character of the string appears in one substring and the other steps required.
 def partitionString ( s ) :
	n = len ( s )
	ans = [ ]
	if ( n == 0 ) :
		print ( " - 1" )
		return
	last_pos = [ - 1 ] * 26
	for i in range ( n - 1 , - 1 , - 1 ) :
		if ( last_pos [ ord ( s [ i ] ) - ord ( ' a ' ) ] == - 1 ) :
			last_pos [ ord ( s [ i ] ) - ord ( ' a ' ) ] = i
	minp = - 1
	plen = 0
	for i in range ( n ) :
		lp = last_pos [ ord ( s [ i ] ) - ord ( ' a ' ) ]
		minp = max ( minp , lp )
		plen += 1
		if ( i == minp ) :
			ans . append ( plen )
			minp = - 1
			plen = 0
	for i in range ( len ( ans ) ) :
		print ( ans [ i ] , end = " ▁ " )
str = " acbbcc "
partitionString ( str )