```
typedef TreeNode node;
class Solution {
public:
int findBottomLeftValue(TreeNode* root) {
int ret;
queue<node *> q;
q.push(root);
bool cont = true;
int sz = 1;
while(!q.empty() && cont) {
ret = q.front()->val;
cont = false;
while(sz--) {
node *n = q.front();
q.pop();
if((n->left || n->right) && !cont)
cont = true;
if(n->left)
q.push(n->left);
if(n->right)
q.push(n->right);
}
sz = q.size();
}
return ret;
}
};
```