Java 2ms CODE
\nclass Solution {\n    public String destCity(List<List<String>> paths) {\n        ArrayList<String> ans=new ArrayList<String>();\n        HashMap<String,Integ
```\nclass Solution {\n    public String destCity(List<List<String>> paths) {\n        ArrayList<String> ans=new ArrayList<String>();\n        HashMap<String,Integer> map=new HashMap<String,Integer>();\n        for(int i=0;i<paths.size();i++)\n        {\n           map.put(paths.get(i).get(0),map.getOrDefault(paths.get(i).get(0),0)+1);\n            ans.add(paths.get(i).get(1));\n            \n        }\n        for(String a:ans)\n        {\n            if(map.get(a)==null)\n            {\n                return a;\n            }\n            \n        }\n        return "";\n        \n    }\n}\n```
['Java']