Search
⌘K

Leetcode 2852. Sum of Remoteness of All Cells

Given an m×n grid with certain "source" cells, compute each cell's remoteness (minimum distance to the nearest source) and return the sum of those distances — a classic multi-source shortest-path / distance-transform problem typically solved with multi-source BFS or DP on the grid for efficiency.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.