vector<int> largestValues(TreeNode* root) {
if (root == nullptr) return res;
for(int i = 0, size = q.size(); i < size; i++) {
root = q.front(); q.pop();
max_v = max(max_v, root->val);
if (root->left) q.push(root->left);
if (root->right) q.push(root->right);