Find Maximum Hidden Island Size
Given an m×n binary grid where 0 represents ocean and 1 represents land, find all islands that are completely surrounded by ocean (not touching the grid boundaries) and return the size of the largest hidden island.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early January, 2026
Meta
Senior
Given mxn grid with 0's and 1's representing Ocean and Land respectively. You need to find the hidden islands within the ocean (atlantis) as shown in example and return the max size of the island. Input: 0 0 0 0 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 Output: 0 0 0 0 1 0 * * 1 1 1 0 0 0 * * 1 0 0 1 0 1 0 * 0 # 0 1 0 0 * * # # # 0 1 0 * * # # # # 0 * * * There are two islands here marked with * and #. Need to return the max size from these island which is 12 (for island marked with *)
Hello Interview Premium
Your account is free and you can post anonymously if you choose.