Making A Large Island (LC #827) asks: flip at most one to and find the largest island. First, label each island with a unique ID and store its size. Then for each , check its neighbors, collect unique island IDs, and sum their sizes plus . Track the maximum. Use a hash map from island ID to size. Edge case: if the grid is all s, return . This runs in time and space. Meta confirmed this as an E4 phone screen question. The two-pass approach is key.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/meta-interview-prep/graphs/making-a-large-island
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████████████████████████████████████████████████████████████████