0651. 4 Keys Keyboard
https://leetcode.com/problems/4-keys-keyboard
Description
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.
Example 1:
Example 2:
Constraints:
1 <= n <= 50
ac
Last updated