Subtree of Another Tree at eBay

Easy51.2% acceptance

This problem has 87.5% frequency at eBay.

Problem Description

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. A subtree of a binary tree `tree` is a tree that consists of a node in `tree` and all of this node's descendants. The t...

Read full problem and hints

Topics

Also asked at 7 companies


More eBay Questions

View all eBay questions