1002 Number of Enclaves
Techniques Used
Graph
Simple DFS
Similar Problem
1254 Number of Closed Islands
Approach
Apply dfs on the boundary elements which are 1's, and "sink" them to '0'. (make all the 1's connected 4-directionally to boundary 1's as 0).
Loop over the gr...
raahulsaxena.hashnode.dev1 min read