728x90
542. 01 Matrix
-
[LeetCode] 542. 01 Matrix c++Coding Test/LeetCode 2023. 1. 3. 17:15
문제 Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. 문제 해결 벡터값 초기화 값을 INT8_MAX로 하니 최대값이 127이라 fail이 나왔다. 1 = 0 && y res[curx][cury] + 1){ res[x][y] = res[curx][cury] + 1; q.push({x, y}); } } } } return res; } };