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
[
3,
7,
2,
9
]
Execution steps
Inspect value
Computed output
9
JavaScript reference implementation
const solve = (a,s)=>{
let b=a[0];
a.forEach((x,i)=>{
b=Math.max(b,x);
s("Inspect value",{
Array:a,Maximum:[b]
},[i])
});
return b
};