Find the maximum area of any island in a binary grid using DFS that returns the size of each connected component. The canonical "DFS with return value" pattern asked at Google, Meta, and Amazon.
Capture every region of Os surrounded by Xs by inverting the problem — flood from the boundary instead of the interior. The classic boundary-DFS pattern interviewers love.
Flip at most one 0 to 1 to maximize island area. The "color the islands, then try every flip" trick avoids quadratic re-DFS — a top Google interview problem.