Symmetric Tree
Easy
Trees
Tree
BFS
DFS
Given a tree as level-order array (null for missing), determine if it's symmetric around center.
Constraints
Nodes ≤ 1000
Examples
Example 1:
Input: 1 2 2 3 4 4 3
Output: true
Example 2:
Input: 1 2 2 null 3 null 3
Output: false
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console