Find All Duplicate Subtrees Leetcode Javascript