```
class Solution {
func findBottomLeftValue(_ root: TreeNode?) -> Int {
guard let root = root else {
return 0
}
var queue = [TreeNode]()
var node = root
queue.append(node)
while !queue.isEmpty {
node = queue.removeFirst()
if let rightNode = node.right {
queue.append(rightNode)
}
if let leftNode = node.left {
queue.append(leftNode)
}
}
return node.val
}
}
```