Final checkpoint: mixed interview rounds
Round two
Two problems, 45 minutes. Both are won or lost on the state you choose.
Take a break first. For both of these, write the state as a full sentence before you write any code. If you cannot finish that sentence, that is what the next five minutes are for, not typing.
The second one is the hardest problem in this module. Getting the state right and running out of time is a respectable outcome on it.
Max Profit With Fee
Unlimited buys and sells, one share at a time, and a fixed fee on every completed sale. Maximize the total. List the situations you can be in and what each one permits, then decide which single transition the fee belongs on.
Two String Formations
Count the ways to build the target by picking characters out of two sources, keeping each source's order, and using at least one character from each. Characters may be skipped in either source, so this is a search rather than a walk down two pointers. Work out everything a state has to remember before you start memoizing.