Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values as subRoot.
Input: root = [3,4,5,1,2], subRoot = [4,1,2]
Output: true
Topics: trees
Asked by: Amazon, Meta, Microsoft, Google
Time complexity: O(m * n). Space complexity: O(m + n).