Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 980 Bytes

80-simple-string-expansion.md

File metadata and controls

11 lines (10 loc) · 980 Bytes

Problem:

Consider the following expansion:

solve("3(ab)") = "ababab" -- "ab" repeats 3 times
solve("2(a3(b))" = "abbbabbb" -- "a3(b)" == "abbb" repeats twice.

Given a string, return the expansion of that string.

Input will consist of only lowercase letters and numbers (1 to 9) in valid parenthesis. There will be no letters or numbers after the last closing parenthesis.

More examples in test cases.

Good luck!

Please also try Simple time difference

Solution