Search⌘ K
AI Features

Solution: Decode String

Solution: Decode String takes an encoded string with nested repetition groups and asks you to return the original text after repeating each bracketed part its stated positive number of times.

Statement

Given an encoded string, return its decoded version. The encoding rule follows the pattern: k[encoded string]k[encoded~string] ...