anchor to 0 and j to -1, which will represent the start and end of the current partition.i.
a. For each character c at index i, update j to be the maximum of j and the last occurrence index of c.
b. If i equals j, we have reached the end of the partition:
i. Append the size of the partition (i - anchor + 1) to the result list.
ii. Update anchor to i + 1 to start a new partition.