Matrix Cells in Distance Order Problem

Matrix Cells in Distance Order Problem — ExecCode Easy DSA Practice

Solve the Matrix Cells in Distance Order problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Description You are given four integers row, cols, rCenter, and cCenter. There is a rows x cols matrix and you are on the cell with the coordinates (rCenter, cCenter). Return the coordinates of all cells in the matrix, sorted by their distance from (rCenter, cCenter) from the sm…

Practice Matrix Cells in Distance Order free on ExecCode. Browse more ExecCode DSA problems.