100. Same Tree
2019-08-06
100. Same Tree
Given two binary trees, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical and the nodes have the same value.
Example 1:
1 | Input: 1 1 |
Example 2:
1 | Input: 1 1 |
Example 3:
1 | Input: 1 1 |
Code:
1 | # Definition for a binary tree node. |
1 | d = collections.deque([]) |