Find Nearest 1 Distance in a Binary Matrix
Given a binary matrix of order m*n, the task is to find the distance of nearest 1 for each 0 in the matrix and print final distance matrix. From any cell (i,j), we can move only in four directions up, down, left and right. Note: Distance from one cell to immediate another cell is always incremented by 1.… Read More »
