Google L3 | Phone Screening | Interview
Anonymous User
1679

Q1: Encode the string -
Input: s = "3[a]2[bc]"
Output: "aaabcbc"

Solved using stack

Q2: Decond the string, return shortest decoded string.
Input: s = "aaabcbc"
Output: "3[a]2[bc]"

Solved using recursion.

Comments (11)