Shortest Path in Binary Matrix at Meta

Medium51.1% acceptance

This problem has 87.5% frequency at Meta.

Problem Description

Given an `n x n` binary matrix `grid`, return _the length of the shortest**clear path** in the matrix_. If there is no clear path, return `-1`. A **clear path** in a binary matrix is a path from the **top-left** cell (i.e., `(0, 0)`) to the **bottom-right** cell (i.e., `(n - 1, n - 1)`) such that:...

Read full problem and hints

Topics

Also asked at 16 companies


More Meta Questions

View all Meta questions