题目:
题解:
Go
func findBottomLeftValue(root *TreeNode) (ans int) {
q := []*TreeNode{root}
for len(q) > 0 {
node := q[0]
q = q[1:]
if node.Right != nil {
q = append(q, node.Right)
}
if node.Left != nil {
q = append(q, node.Left)
}
ans = node.Val
}
return
}