Skip to main content
Subtree of Another Tree | AlgoCracked
AlgoCracked
ProblemsSubtree of Another Tree
Easy47.0% acceptance
Blind75TreeDfsString Matching

Subtree of Another Tree

Given the roots of two binary trees root and subRoot , return true if subRoot appears as a subtree of root (a node of root whose whole subtree equals subRoot ). Input format Input is [root, subRoot] as level-order arrays, e.g. [[3,4,5,1,2],[4,1,2]] . TreeNode is predefined.

Loading workspace…