Back to problems

Decode String (k[encoded])

Algorithm · Oracle · Medium

Requirements Input: a string written in an encoded form. A fragment written as k[encoded_string] means that the contents between the brackets must appear k consecutive times. k is always an integer greater than zero. The supplied string is guaranteed valid: it contains no stray spaces, every bracket has its matching partner, and numeric characters are used only for repetition counts rather than within encoded_string. Invalid arrangements such as 5x (a number not immediately…

Checking your access…