Minimum Manhattan distance between X and Y in a matrix

0
Practice

Find the smallest Manhattan distance between any X cell and any Y cell in a matrix. Reported on 1point3acres' Glean bank; reconstructed in our own words.

GleanCoding
No answer yet. Write the first one; the best answer gets endorsed.