The problem, in one line. Cut a string of letters into as many pieces as possible so that no letter shows up in two pieces, and return the length of each piece. LeetCode 763.
The tell. “As many pieces as possible” under a rule about where each item may appear. If each letter has a last position, that position tells you how far the current piece must stretch.