Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Decode String
Medium
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given an encoded string, return its decoded string.
Sample Input:
"3[a]2[bc]"
Sample Output:
"aaabcbc"
Hints
Hint 1
Use stack to handle nested patterns
Hint 2
Push numbers and strings onto separate stacks
Hint 3
When encountering ']', pop and repeat
Code Editor
Reset
Run
Save
Loading...