• Tutorials
  • DSA
  • Data Science
  • Web Tech
  • Courses
August 07, 2024 0

SDE Sheet - Special Keyboard

Description
Discussion

This video is part of the Recursion and Backtracking section under GFG SDE Sheet.

Imagine you have a special keyboard with the following keys: 

Key 1:  Prints 'A' on screen
Key 2: (Ctrl-A): Select screen
Key 3: (Ctrl-C): Copy selection to buffer
Key 4: (Ctrl-V): Print buffer on screen appending it after what has already been printed.

Find maximum numbers of A's that can be produced by pressing keys on the special keyboard N times. 


Example 1:

Input: N = 3
Output: 3
Explanation: Press key 1 three times.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-
Problem: https://www.geeksforgeeks.org/problems/special-keyboard3018/1
SDE Sheet Link: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/
Article Link: https://www.geeksforgeeks.org/how-to-print-maximum-number-of-a-using-given-four-keys/