Expand Given String

Problem Overview

  • Expand a compressed string by repeating grouped substrings according to the given rules.
  • Input: a string with substrings grouped by parentheses and repeat counts; Output: the fully expanded string.
  • Domain: string parsing and text processing where patterned inputs are decoded to plain text.
  • From Cisco interviews; a coding interview problem and a common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: