threeal / leetspace

A dedicated workspace and archive for my LeetCode submissions
https://leetcode.com/threeal
MIT License
1 stars 1 forks source link

Solve Problem 542. 01 Matrix #1378

Open threeal opened 1 month ago

threeal commented 1 month ago

This issue suggests solving the problem 542. 01 Matrix. To achieve this, one can use a breadth-first search approach for each cell that contains a zero and calculate the distance to the nearby cells accordingly.