You are viewing a single comment's thread. Return to all comments →
I don't even bother storing leftD and rightD.
if(j == k) { result += curInput; } if(j+k+1 == numInputs) { result -= curInput; } ans = abs(result);
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →
I don't even bother storing leftD and rightD.