Easy
Check whether one tree is a subtree of another.
Return true if subRoot appears in root as a subtree with identical structure and values.
Examples
Input: root = [3,4,5,1,2], subRoot = [4,1,2]
Output: true
Constraints
- Trees may be empty
Coding Challenge
Check whether one tree is a subtree of another.
Return true if subRoot appears in root as a subtree with identical structure and values.
Input: root = [3,4,5,1,2], subRoot = [4,1,2]
Output: true
Preparing your coding workspace...