🌳56. ⭐ Recursive [ DFS ] || Post Order Traversal || Short & Sweet Code !! || C++ Code Reference !!
Intuition\n- Post Order Traversal !!\n# Code\ncpp [There You Go !!]\n\n    pair<TreeNode*,int>f(TreeNode* a)\n    {\n        if(!a) return {nullptr,0};\n\n     
# Intuition\n- Post Order Traversal !!\n# Code\n```cpp [There You Go !!]\n\n    pair<TreeNode*,int>f(TreeNode* a)\n    {\n        if(!a) return {nullptr,0};\n\n        pair<TreeNode*,int> l=f(a->left);\n        pair<TreeNode*,int> r=f(a->right);\n\n        if(r.second>l.second) return {r.first,r.second+1};\n        else if(l.second>r.second) return {l.first,l.second+1};\n        else return {a,l.second+1};\n    }\n\npublic:\n    TreeNode* subtreeWithAllDeepest(TreeNode* a) {\n        return f(a).first;\n    }\n\n\n```\n\n---\n# *Guy\'s Upvote Pleasee !!* \n![up-arrow_68804.png](https://assets.leetcode.com/users/images/05f74320-5e1a-43a6-b5cd-6395092d56c8_1719302919.2666397.png)\n\n# ***(\u02E3\u203F\u02E3 \u035C)***
['Hash Table', 'Tree', 'Depth-First Search', 'Breadth-First Search', 'Recursion', 'Binary Tree', 'C++']