Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Track nested context with two stacks: one for repeat counts and one for partial strings. On opening bracket, push current context. On closing bracket, pop and expand the built segment by its repeat count.
Each bracketed level saves its outer state, so nested expansions resolve inner to outer in LIFO order and rebuild the final decoded string correctly.
Updated Feb 2026