Search
⌘K

Leetcode 394. Decode String

Decode a string containing nested repeat patterns of the form k[encoded_string], expanding each bracketed segment k times (k may be multi-digit) possibly with multiple nesting levels. Core challenge: parse and evaluate the nested structure correctly and efficiently (e.g., via stack or recursion) to produce the fully decoded string.

Asked at:

Microsoft

Microsoft

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late October, 2025

Microsoft

Microsoft

Senior

Late December, 2024

Google

Google

Mid-level

Decode string

Comments

Your account is free and you can post anonymously if you choose.