Kotlin solution
Complexity\n\n- Time complexity: $O(n)$\n- Space complexity: $O(n)$\n\n# Code\n\n\nclass Solution {\n    fun destCity(paths: List<List<String>>): String {\n    
# Complexity\n\n- Time complexity: $O(n)$\n- Space complexity: $O(n)$\n\n# Code\n\n```\nclass Solution {\n    fun destCity(paths: List<List<String>>): String {\n        val end = paths.asSequence().map { it[1] }.toSet()\n        val start = paths.asSequence().map { it[0] }.toSet()\n        return (end - start).single()\n    }\n}\n```
['Kotlin']