# 513. Find Bottom Left Tree Value

[Link](https://leetcode.com/problems/find-bottom-left-tree-value/)

**Solution**

Do the degree traversal and find record the first one.

```java
class Solution {
    public int findBottomLeftValue(TreeNode root) {
        int ret = root.val;
        Queue<TreeNode> childs = new LinkedList<>();
        childs.add(root);
        
        while(!childs.isEmpty()){
            
            int count = childs.size();
            boolean isFirst = true;
            while(count != 0){
                TreeNode node = childs.poll();
                
                if(isFirst){
                    ret = node.val;
                    isFirst = false;
                }
                if(node.left != null){
                    childs.add(node.left);
                }
                if(node.right != null){
                    childs.add(node.right);
                }
                count--;
            }
        }
        return ret;
    }
}
```
