C++ recursive dfs approach
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(log2N)\n- wordt case - O(N) when tree is skewed<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(Height of the Tree)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\nclass Solution {\npublic:\n\n    void recr(TreeNode* curr, int level, pair<int,int>& ans){\n        if(curr == NULL) return;\n\n        if(ans.first<level){\n            ans.first = level;\n            ans.second = curr->val;\n        }\n        recr(curr->left, level+1, ans);\n        recr(curr->right, level+1, ans);\n    }\n\n    int findBottomLeftValue(TreeNode* root) {\n        queue<pair<TreeNode*,int>>q;\n        q.push({root, 0});\n        pair<int,int> ans {-1, -1};\n        recr(root, 0, ans);\n        return ans.second;\n        // int hl = INT_MAX;\n\n        // while(!q.empty()){\n        //     int size = q.size();\n        //     ans = q.front().first->val;\n        //     for(int i=0;i<size;i++){\n        //         TreeNode* currNode = q.front().first;\n        //         int currHl = q.front().second;\n        //         q.pop();\n        //         if(currHl<hl){\n        //             hl = currHl;\n        //             ans = currNode->val;\n        //         }\n        //         TreeNode* left = currNode->left;\n        //         TreeNode* right = currNode->right;\n        //         if(left != NULL){\n        //             q.push({left, currHl-1});\n        //         }\n        //         if(right != NULL){\n        //             q.push({right, currHl+1});\n        //         }\n        //     }\n            \n        // }\n        // return ans;\n    }\n};\n```
['C++']