Subtree of Another Tree
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 of subRoot and false otherwise.
Subtree of Another Tree

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 of subRoot and false otherwise.

Example 1:
Input: {"root":[3,4,5,1,2],"subRoot":[4,1,2]}
Output: true
Input
arr ={"root":[3,4,5,1,2],"subRoot":[4,1,2]}

3

4

5

1

2

4

1

2

Variables
No variables to display
DepthFunction Call
Stack empty
0/4