Leetcode 695. Maximum area of the island

subject Give you a binary matrix grid of size m x n. An island is a combination of some adjacent 1s (representing land). The "adjacent" here requires that two 1s must be adjacent in four horizontal or vertical directions. You can assume that the four edges of the grid are surrounded by 0 (representing water). The area of an island ...

Posted on Wed, 13 Oct 2021 13:19:31 -0400 by $0.05$

Leetcode547. Number of provinces (medium)

subject Problem solution n cities and the connection relationship between them can be regarded as a graph. The city is the node in the graph, and the connection relationship is the edge in the graph. The given matrix isConnected is the adjacency matrix of the graph, and the province is the connected component in the graph. Calculating the ...

Posted on Sat, 09 Oct 2021 00:46:33 -0400 by DESIGNGRAPHY