def pathSum(self, root, sum):
        """
        :type root: TreeNode
        :type sum: int
        :rtype: int
        """
        self.result = 0
        self.pathSumHelper(root, sum, 0, {0: 1})
        return self.result

        :type root: TreeNode
        :type sum: int
        :rtype: int
        
python/437_Path_Sum_III.py