Java Solution using BFS, fully explained
\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode() {}\n
```\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode() {}\n *     TreeNode(int val) { this.val = val; }\n *     TreeNode(int val, TreeNode left, TreeNode right) {\n *         this.val = val;\n *         this.left = left;\n *         this.right = right;\n *     }\n * }\n */\nclass Solution {\n    public int findBottomLeftValue(TreeNode root) {\n        if(root==null) return -1;\n        LinkedList<TreeNode> queue=new LinkedList<>();\n        queue.addLast(root);\n        \n        int ans=root.val;\n        \n        while(queue.size()!=0){\n            int size=queue.size();\n            //----------flag to see if the first element of the level is encountered or not--------\n            boolean flag=false;\n            \n            while(size-->0){\n                TreeNode node=queue.removeFirst();\n                \n                //-------------------------if the node is leaf node or not--------------------------\n                if(node.left==null && node.right==null){\n                    \n                    //-----------if the node is the first leaf node of the current level------------\n                    if(flag==false){\n                        ans=node.val;\n                        flag=true;\n                    }\n                }\n                \n                //-----------------------Pushing the nodes which are on the next level--------------\n                if(node.left!=null)  queue.addLast(node.left);\n                if(node.right!=null)  queue.addLast(node.right);\n            }\n        }\n        return ans;\n    }\n}\n```
['Breadth-First Search', 'Java']