LC 100
Same Tree
Easy · LC 1–100 + first-family candidate
Candidate solution routes
Tree level-order BFS
Invariant: At each round start, the queue contains every node of the current depth and no other depth. After exactly level_size pops, it contains exactly the next depth.
candidate confidence: 0.523 · metadata_only
Tree recursive aggregation
Invariant: dfs(u) returns a summary concerning only u's subtree and satisfying its parent contract; before return, every global candidate fully contained in that subtree has been considered.
candidate confidence: 0.603 · metadata_only
DFS Components and Reachability
Invariant: Once marked visited, a vertex belongs to the component represented by the current search and can never join a later component.
candidate confidence: 0.610 · metadata_only
BFS Connectivity Traversal
Invariant: Every queued vertex is discovered and assigned to the current component but not fully expanded; an unseen vertex is not yet proven reachable from this start.
candidate confidence: 0.464 · metadata_only
How to use this page
Read the statement and constraints first, then validate recognition signals, invariant, and complexity. Candidate score is not correctness evidence.