# Definition for a binary tree node.
class TreeNode(object):
     def __init__(self, x):
         self.val = x
         self.left = None
         self.right = None
class Solution:
    def binaryTreePaths(self, root):
        """
        :type root: TreeNode
        :rtype: List[str]
        """
        self.ans=[]
        def helper(root,str1):
            if root.left==None and root.right==None:
                self.ans.append(str1)
                return
            if root.left:
                helper(root.left,str1+"->"+str(root.left.val))
            if root.right:
                helper(root.right,str1+"->"+str(root.right.val))
            return
        if root:
            helper(root,str(root.val))
        return self.ans
s=Solution()
root=TreeNode(2)
root.left=TreeNode(0)
root.right=TreeNode(3)
root.left.left=TreeNode(-4)
root.left.right=TreeNode(-1)
print(s.binaryTreePaths(root))

