Problem 572 · Easy

Subtree of Another Tree

DFS: at each node check if the subtree matches subRoot using an isSameTree helper.

Open the interactive visualisation