```
class Solution:
def getChild(self,root):
if not root:
return []
tmp = self.getChild(root.left)+self.getChild(root.right)
return [str(root.val)+'->'+str(i) for i in tmp] if tmp else [str(root.val)]
# @param {TreeNode} root
# @return {string[]}
def binaryTreePaths(self, root):
if not root:
return []
return self.getChild(root)
```