Problem 651 · Medium

4 Keys Keyboard

Find the largest number of A characters that can be produced in n presses of a four-key keyboard. The visual tracks the best screen and buffer states at each press.

Open the interactive visualisation