Problem 3628 · Medium

Maximum Number of Subsequences After One Inserting

Count the LCT subsequences, then compare the gain from inserting L at the front, T at the end, or C at its best position.

Open the interactive visualisation