You are viewing a single comment's thread. Return to all comments →
$first = $second=0; $j = $n-1; for($i=0;$i<$n; $i++){ $first +=$a[$i][$i]; $second +=$a[$i][$j]; $j--; } $result= abs($first-$second); print abs($result);
Seems like cookies are disabled on this browser, please enable them to open this website
Diagonal Difference
You are viewing a single comment's thread. Return to all comments →