parameters: (self, root)
return_statement: return tree_list
docstring: :type root: TreeNode
          :rtype: List[TreeNode]
docstring_summary: :type root: TreeNode
          :rtype: List[TreeNode]
docstring_tokens: : type root : TreeNode : rtype : List [ TreeNode ]
function: def findDuplicateSubtrees(self, root):
          """
          :type root: TreeNode
          :rtype: List[TreeNode]
          """
  
          if not root:
              return []
          tree_list = []
          cnt = collections.Counter()
  
          def Traverse(node):
              if not node:
                  return '#'
              serialized_tree = "{}{}{}".format(
                  node.val, Traverse(node.left), Traverse(node.right))
              cnt[serialized_tree] += 1
              if cnt[serialized_tree] == 2:
                  tree_list.append(node)
              return serialized_tree
  
          Traverse(root)
          return tree_list
function_tokens: def findDuplicateSubtrees ( self , root ) : if not root : return [ ] tree_list = [ ] cnt = collections . Counter ( ) def Traverse ( node ) : if not node : return '#' serialized_tree = "{}{}{}" . format ( node . val , Traverse ( node . left ) , Traverse ( node . right ) ) cnt [ serialized_tree ] += 1 if cnt [ serialized_tree ] == 2 : tree_list . append ( node ) return serialized_tree Traverse ( root ) return tree_list