int getHeight(TreeNode *root){if(!root) return 0;return max(getHeight(root->left),getHeight(root->right))+1;}