← Paytm questions

Check if tree2 is subtree of tree1 and count nodes

Filed under Paytm

Given two binary trees, tree1 and tree2, determine if tree2 is a subtree of tree1. If it is, return the total number of nodes in tree2; otherwise, return 0.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Paytm questions

Collected from public candidate posts and coding forums. Updated Nov 2026.