Company: Zomato
Difficulty: medium
Special Keyboard Problem Description 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 the maximum number of A 's that can be produced by pressing keys on the special keyboard N times. Input The first line contains a single integer N . Output Your task is to return the maximum number of A 's that can be on the screen after performing N operations. Examples Example 1: Input: 7 Output: 9 Example 2: Input: 2 Output: 2 Constraints 2 Decode String Problem Description Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string] , where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer. You may assume that the input string is always valid. No extra white spaces, square