AppleMachine Learning Engineer · Take-home ProjectCodemia practiceFind shortest distance in grid
Given a 2D grid of cells where each cell represents a point in a coordinate system, find the shortest distance from a starting cell to a target cell while only being able to move up, down, left, or right. The grid may contain obstacles that cannot be traversed, and you should return the minimum number of steps required to reach the target cell, or -1 if it is not reachable.
Medium
Coding & Algorithms