Leetcode Problem 1102. Path With Maximum Minimum Value
1102. Path With Maximum Minimum Value
Leetcode Solutions
Approach: BFS + PriorityQueue
Initialize a priority queue and insert the top-left cell (0, 0) with its value.
Mark the top-left cell as visited.
While the priority queue is not empty:
a. Pop the cell with the largest value from the priority queue.
b. If this cell is the bottom-right cell, return its value as the maximum score.
c. For each of the 4 neighboring cells (up, down, left, right):
i. If the neighbor is within bounds and not visited:
- Mark it as visited.
- Insert it into the priority queue with its value.