Follow the computed execution on the reference input. Advance one step at a time, inspect the changing values and compare your prediction with the final output.
Example input
"(1+(2*3)+((8)/4))+1"
Execution steps
Track nesting
Computed output
3
JavaScript reference implementation
const solve = (a,s)=>{
let d=0,b=0;
for(let x of a){
if(x==="(")d++;
if(x===")")d--;
b=Math.max(d,b);
s("Track nesting",{
Token:[x],Depth:[d],Best:[b]
})
}
return b
};