Imagine you have a special keyboard with the following keys:
- A: Print one ‘A’ on the screen.
- Ctrl-A: Select the whole screen.
- Ctrl-C: Copy selection to buffer.
- Ctrl-V: Print buffer on screen appending it after what has already been printed.
Given an integer n, return the maximum number of ‘A’ you can print on the screen with at most n presses on the keys.
1 | class Solution { |