Given an m x n matrix with values 0, 1, and -1 (obstacles), compute the distance from each cell to the nearest 1 using 8-directional movement (horizontal, vertical, diagonal). Obstacles (-1) cannot be…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.