DoorDash Interview Question

Find each cell's nearest source in a grid