```
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""
r = [None, 0] # [val, depth]
def search(node, depth):
if not node: return
if depth >= r[1]:
r[0] = node.val
r[1] = depth
search(node.right, depth + 1)
search(node.left, depth + 1)
search(root, 1)
return r[0]
```