There are two binary trees: a big one named root and a small one named subRoot. Answer true when root has a node that, with everything below it, looks exactly like subRoot (same shape, same values). If there is no such node, answer false.
The whole tree root also counts as a subtree of itself.
How the judge passes the data
Examples
Example 1:
Input: root = [10,6,12,3,7], subRoot = [6,3,7]
Output: true
Explanation: The node 6 and everything below it looks exactly like subRoot.
Example 2:
Input: root = [9,4,5,null,2,3], subRoot = [4,2]
Output: false
Explanation: In root, the node 4 has 2 as its right child. In subRoot, 2 is a left child. The shapes differ.
Example 3:
Input: root = [9,4,5,null,2,3], subRoot = [5,3]
Output: true
Explanation: The node 5 has the left child 3, which matches subRoot.