Two binary trees are the same if they have the same shape and every pair of matching nodes holds the same value. Given two trees p and q, return true if they are the same, and false if they are not.
How the judge passes the data
Examples
Example 1:
Input: p = [4,5,6], q = [4,5,6]
Output: true
Explanation: The shape and all values match.
Example 2:
Input: p = [7,8], q = [7,null,8]
Output: false
Explanation: In p the node 8 is a left child. In q it is a right child. The shapes differ.
Example 3:
Input: p = [2,9,2], q = [2,2,9]
Output: false
Explanation: The shape is the same, but the two children hold different values.