Company: Amazon_10_feb
Difficulty: medium
Path Problem Path Problem Description Given an n x m grid, where rows are numbered from 1 to n and columns from 1 to m , there are x blocked cells. Their positions are specified by the array blockedPositions[i] where blockedPositions[i][0] represents the row and blockedPositions[i][1] represents the column position, using 1-based indexing. Starting from the top-left cell (1, 1) , the goal is to reach the bottom-right cell (n, m) without visiting any blocked cells. Movement is allowed only up, down, left, or right. The strength of a path is defined as the minimum Manhattan distance from each cell in the path to the nearest blocked cell. To calculate the strength of a specific path, an array minDist[] is created, where minDist[i] represents the minimum distance to any blocked cell for the i th cell visited. The strength of the path is given by min(minDist[]) . Among all possible paths from (1, 1) to (n, m) , determine the path that maximizes strength. If multiple paths have the same maxi