Manhattan Distance

<p><strong>Manhattan Distance in Matrices</strong></p> <p>The same concept can also be applied in matrices-<br /> where the x1, x2, y1, and y2 denote the row numbers and column numbers of two cells respectively. In that case, the Manhattan Distance between any two cells namely c1 and c2 is &mdash; |x1-x2|+|y1-y2|.</p> <p><strong>Application</strong></p> <p>Now let&rsquo;s see an application of the same concept, the &lsquo;Beautiful Matrix&rsquo; question from Codeforces Round 161 (Div. 2).</p> <p><a href="https://medium.com/@tanctanc03/manhattan-distance-edd45e401fa3"><strong>Visit Now</strong></a></p>