Traverse a graph depth-first using recursion.
Detect if an undirected graph contains a cycle.
Count the number of connected components in an undirected graph.
Compute n! recursively.
Count islands in a 2D grid of '1' (land) and '0' (water).
Deep copy a graph. Each node has a value and neighbor list.
Change all connected cells of the same color starting from (sr, sc).
Count nodes where the node's value is greater than or equal to all values on the path from root.
Given a board of 'X' and 'O', capture all regions surrounded by 'X' (flip 'O' to 'X'), except those connected to the border.