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
[
2,
2,
3,
2
]
Execution steps
Count bit modulo three
Computed output
3
JavaScript reference implementation
const solve = (a,s)=>{
let v=0;
for(let i=0;
i<4;
i++){
let c=a.reduce((n,x)=>n+((x>>i)&1),0);
if(c%3)v|=1<<i;
s("Count bit modulo three",{
Bit:[i],Count:[c],Result:[v]
})
}
return v
};