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
Compress the string into run lengths of consecutive equal characters and add the minimum of each adjacent run pair.
A valid substring across a 0/1 boundary can use at most the shorter adjacent run length.
Updated Feb 2026