LeetCode 652: Find Duplicate Subtrees
Problem Restatement We are given the root of a binary tree. We need to find all duplicate subtrees. Two subtrees are duplicate when they have: Requirement Meaning Same structure The nodes are arranged in the same shape Same values Matching nodes have equal values For each kind of duplicate subtree, we only return one root node. For example, if the same subtree appears three times, we still add only one...