Shortest Bridge

Try to solve the Shortest Bridge problem.

Statement

We are given an n×nn×n binary matrix grid containing 0s and 1s. Each cell in the grid represents either land or water. A cell with a value of 1 represents land, while a cell with a value of ...