✅ code in 2mins || simple || Python
Intuition\nThe problem asks to find the destination city, which is the city that is not the starting city in any route. One intuitive way to solve this is to cr
# Intuition\nThe problem asks to find the destination city, which is the city that is not the starting city in any route. One intuitive way to solve this is to create sets for the starting cities and destination cities, and then find the city that is in the destination set but not in the starting set.\n\n\n# Approach\n- Create two sets: **"fir"** for the starting cities and **"sec"** for the destination cities.\n- Find the set difference (**"ans"**) between the **"sec"** and **"fir"**.\n- Return the element in **"ans"**.\n\n# Complexity\n- Time complexity:\nO(n), where n is the number of routes (length of the paths list)\n- Space complexity:\nO(n), as we are creating sets for both starting and destination cities.\n# Code\n```\nclass Solution:\n    def destCity(self, paths: List[List[str]]) -> str:\n\n        sec = set(path[1] for path in paths)\n        fir = set(path[0] for path in paths)\n        ans = sec - fir\n        return ans.pop()\n        \n```
['Python3']