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,
1,
3,
2,
5
]
Execution steps
Separate by differing bit
Computed output
[
3,
5
]
JavaScript reference implementation
const solve = (a,s)=>{
let x=a.reduce((v,y)=>v^y,0),bit=x&-x,l=0,r=0;
for(let y of a){
if(y&bit)l^=y;
else r^=y;
s("Separate by differing bit",{
Mask:[bit],Groups:[l,r]
})
}
return [l,r].sort((a,b)=>a-b)
};