Easy to understand C++ || 2 approaches || map and unordered_map
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:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string destCity(vector<vector<string>>& paths) {\n    /*\n        map<string,vector<string>> adj;\n        for(int i=0; i<paths.size(); i++){\n            string u = paths[i][0];\n            string v = paths[i][1];\n\n            adj[u].push_back(v);\n        }\n        for(int i=0; i<paths.size(); i++){\n            string v = paths[i][1];\n            if(adj.find(v) == adj.end())    return v;\n        }\n        \n        return "";\n    */\n        unordered_map<string,pair<int,int>> out; // <int,int> == <outgoing,incoming>\n        for(int i=0; i<paths.size(); i++){\n            string u = paths[i][0];\n            string v = paths[i][1];\n\n            out[u].first++;\n            out[v].second++;\n        }\n        for(auto i:out){\n            if(i.second.first == 0)   return i.first;\n        }\n        return "";\n    }\n};\n```
['C++']