class solution():
	def findDuplicateSubtree(self, root):
		def trv(root):
			if not root:
				return "null"
			struct = "%s,%s,%s" % (str(root.val), trv(root.left), trv(root.right))
			nodes[struct].append(root)
			return struct
		nodes = {}
		trv(root)
		return [nodes[struct][0] for struct in nodes if len(nodes[struct])>1]