https://leetcode.com/problems/destination-city/description/ Easy

Решение

class Solution {
    fun destCity(paths: List<List<String>>): String {
        val outgoing = mutableSetOf<String>()
        for (path in paths) {
            outgoing.add(path[0])
        }
        for (path in paths) {
            if (!outgoing.contains(path[1])) {
                return path[1]
            }
        }
        return ""
    }
}