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,
4
],
[
3,
2
]
]
Execution steps
Find maximum in column
Computed output
[
1,
0
]
JavaScript reference implementation
const solve = (a,s)=>{
let l=0,r=a[0].length-1;
while(l<=r){
let j=(l+r)>>1,i=0;
for(let k=1;
k<a.length;
k++)if(a[k][j]>a[i][j])i=k;
let x=a[i][j],left=a[i][j-1]??-Infinity,right=a[i][j+1]??-Infinity;
s("Find maximum in column",{
Matrix:a,Cell:[i,j]
});
if(x>left&&x>right)return [i,j];
if(left>x)r=j-1;
else l=j+1
}
return []
};