# Tag Archives: algorithm

## Calculate the diagonal difference of an N x N matrix

Below are diagonal difference code samples in PHP and Python that I have submitted to hackerrank.com <?php /** * Calculate the diagonal difference of an N x N matrix * * runs in O(n) * * @param int $n size … Continue reading