Given two binary trees, writeafunctiontocheckiftheyarethesameornot.
Two binary trees are considered the same if they are structurally identical andthe nodes have the same value.
Example 1:
Input:
11
/ \ / \
2323
[1,2,3], [1,2,3]
Output: true
Example 2:
Input:
11
/ \
22
[1,2], [1,null,2]
Output: false
Example 3:
Input:
11
/ \ / \
2112
[1,2,1], [1,1,2]
Output: false
提交反馈:
57 / 57 test cases passed.
Status: Accepted
Runtime:3 ms
Submitted:3 minutes ago
You are here!
Your runtime beats 98.53 % of java submissions.