Reported interview periodDec 2025–Jul 2026
Decode a Nested String
An encoded string uses the form k[segment], meaning that segment is repeated k times. Repeat counts are positive and may contain multiple digits. Encoded segments may be nested, while ordinary characters are co…
Practice focusImplement: Examples: - 3[a]2[bc] becomes aaabcbc . - 3[a2[c]] becomes accaccacc . - 2[abc]3[cd]ef becomes abcabccdcdcdef . Assume the input is syntactically valid. Avoid recursion-depth dependence by using an explicit stack. The running time should be proportional to the encoded input plus the produced output. Staged follow-ups 1. Validate malformed input and report the location of the first syntax error. 2. Support a postfix form such as (segment){k} and escaped delimiter characters. 3.…