C# | Fast, easy to read and compact solution using one Hashset
Complexity\n- Time complexity:\nO(n)\n\n- Space complexity:\nO(n)\n\n# Code\n\npublic class Solution \n{\n    public string DestCity(IList<IList<string>> paths)
# Complexity\n- Time complexity:\n$$O(n)$$\n\n- Space complexity:\n$$O(n)$$\n\n# Code\n```\npublic class Solution \n{\n    public string DestCity(IList<IList<string>> paths) \n    {\n        var set = new HashSet<string>();\n\n        foreach (var path in paths) \n            set.Add(path[1]);\n        \n        foreach (var path in paths) \n            set.Remove(path[0]);\n\n        return set.First();\n    }\n}\n```
['C#']