Partition Labels
Signals to notice
Brute force first
Try all possible partition points. Each position is either a cut or not. It is a fair place to begin because it matches the surface of the question, yet it does not capture the deeper structure that makes the problem simpler.
The key insight
First pass: record each character's last occurrence. Second pass: expand the current partition to include the last occurrence of every character in it. When you reach the partition boundary, cut. Once you hold onto the right piece of information from moment to moment, the problem feels less like trial and error and more like following a shape that was there all along.
What must stay true
If character 'a' appears at positions 2 and 8, any partition containing position 2 must also contain position 8. The partition boundary is the maximum last occurrence of any character in it. When you keep that truth intact, each local choice supports the larger solution instead of fighting it.
Easy way to go wrong
Greedily cutting at the first opportunity without checking if later characters force the partition to extend. The max-last-occurrence tracking handles this. The fix is usually to return to the meaning of each move, not just the steps themselves.