25. Same Tree
EasyTrees
Return true if two binary trees have the same shape and the same value at every node.
A binary tree is passed as TreeNode objects with val, left and right. The tests write trees in level order, with null for a missing child.
Example 1
Input: a = [1, 2, 3], b = [1, 2, 3] Output: true
Example 2
Input: a = [1, 2], b = [1, null, 2] Output: false
Constraints
0 ≤ nodes in each tree ≤ 100