You are given four integers rows, cols, rCenter, and cCenter, representing a matrix with dimensions rows cols and a specified center cell at coordinate (rCenter, cCenter).
Return a list of the coordinates of all cells in the matrix, ordered by their Manhattan distance from (rCenter, cCenter) in nondecreasing order.
The Manhattan distance between two cells
Note: If multiple cells have the same distance from the center, they may appear in any order relative to each other.
Constraints:
rows, cols
rCenter rows
cCenter cols
You are given four integers rows, cols, rCenter, and cCenter, representing a matrix with dimensions rows cols and a specified center cell at coordinate (rCenter, cCenter).
Return a list of the coordinates of all cells in the matrix, ordered by their Manhattan distance from (rCenter, cCenter) in nondecreasing order.
The Manhattan distance between two cells
Note: If multiple cells have the same distance from the center, they may appear in any order relative to each other.
Constraints:
rows, cols
rCenter rows
cCenter cols