Easy to follow JavaScript with only Map
\n\nvar destCity = function(paths) {\n    let map = new Map();\n    for (let [s, d] of paths) { // set source and destination\n        map.set(s, d);\n        m
\n```\nvar destCity = function(paths) {\n    let map = new Map();\n    for (let [s, d] of paths) { // set source and destination\n        map.set(s, d);\n        map.set(d, map.get(d) || null); // if there is no destination already in the map, then set null <-- this is our answer\n    }\n\n    for (let [s, d] of map.entries()) { // find source with destination null\n        if (d === null) return s;\n    }\n    \n    return null;\n};\n```
['JavaScript']