Sem observação adicional neste relato público.
Leetcode 934. Shortest Bridge
Given an n×n binary grid containing exactly two 4-connected islands, return the minimum number of 0→1 flips needed to connect them. The core challenge is finding the shortest bridge between island boundaries (commonly solved by marking one island and doing a multi-source BFS outward across water until the other island is reached).
Onde essa pergunta já apareceu
Use esses exemplos para entender em que contexto ela costuma cair e adaptar sua prática.
You are given an n x n binary matrix grid where 1 represents land and 0 represents water. An island is a 4-directionally connected group of 1's not connected to any other 1's. There are exactly two islands in grid. You may change 0's to 1's to connect the two islands to form one island. Return the smallest number of 0's you must flip to connect the two islands.
Materiais associados
Nenhum anexo público associado a esta pergunta.
Continue a preparação com o banco completo
No app você encontra perguntas parecidas, compara empresas e aprofunda essa busca com mais filtros.