
...
class Solution {
int val,height;
public int findBottomLeftValue(TreeNode root) {
leftmost(root,1);
return val;
}public void leftmost(TreeNode root,int length){
if(length >height){
height = length;
val = root.val;
}
if(root.left != null)
leftmost(root.left,length+1);
if(root.right !=null)
leftmost(root.right,length+1);
}
}
...