Java Easy Solution|| Beats 100% solution||Properly explained||Like or upvote if it helps
Intuition\n Describe your first thoughts on how to solve this problem. \nTo find the bottom-left element of the tree:\n1. We observe that the bottom-left elemen
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nTo find the bottom-left element of the tree:\n1. We observe that the bottom-left element will be the first encountered node at the maximum height of the tree.\n2. To track the first element at the maximum height, we use a queue.\n3. We begin by recursively traversing the left subtree first, followed by the right subtree.\n4. During traversal, we prioritize exploring the left subtree to ensure that the leftmost element at the maximum height is encountered first.\n5. As we traverse, if we encounter a node at the maximum height, we add its value to the queue.\n6. If the queue size is 1, it means we\'ve found the bottom-left element, and we can terminate the traversal early.\n7. We return the value at the front of the queue as the bottom-left element of the tree.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\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    private Queue<Integer> q = new LinkedList<>();\n    public int findBottomLeftValue(TreeNode root) {\n        int ht = maxHt(root,0);\n        find(root,1,ht);\n        return q.peek();\n    }\n\n    public int maxHt(TreeNode root,int lvl) {\n        if(root == null) {\n            return lvl;\n        }\n\n        return Math.max(maxHt(root.left,lvl+1),maxHt(root.right,lvl+1));\n    }\n\n    public void find(TreeNode root,int lvl,int ht) {\n        if(root==null) {\n            return;\n        }\n\n        if(lvl == ht && q.isEmpty()) {\n            q.add(root.val);\n            return;\n        }\n        if(q.isEmpty()) {\n            find(root.left,lvl+1,ht);\n        }\n        if(q.isEmpty()) {\n            find(root.right,lvl+1,ht);\n        }\n    }\n}\n```
['Java']