← Questions

Symmetric tree

0
FigmaCodingLast asked Feb 2026

Given the root of a binary tree, return whether it is a mirror image of itself around its centre. Compare the left and right subtrees pairwise: outer children with outer children, inner with inner. Write it recursively, then iteratively with a queue.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding