Back to course home
0% completed
Vote For New Content
Solution: Making A Large Island
Problem Statement
Given a 2D binary matrix of size n x n
, return the integer representing the size of the largest island
after changing at most 0
to 1
.
Here, Island
is defined as a 4-directionally
connected group of 1
s.
Examples
- Example 1:
- Input:
[[1, 0, 1, 0], [0, 1, 1, 0], [0, 0, 0, 1], [1, 1, 0, 0]]
- Expected Output:
6
- Input:
.....
.....
.....
Like the course? Get enrolled and start learning!
Table of Contents
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible
Contents are not accessible