JAVA || EASY UNDERSTAING || USING RECURSION || DFS
Code\n\nclass Solution {\n    public List<String> findAllConcatenatedWordsInADict(String[] words) {\n        List<String>al=new ArrayList<>();\n        Set<Stri
# Code\n```\nclass Solution {\n    public List<String> findAllConcatenatedWordsInADict(String[] words) {\n        List<String>al=new ArrayList<>();\n        Set<String>hs=new HashSet<>();\n        for(String i:words) hs.add(i);\n        Map<String,Integer>hm=new HashMap<>();\n        for(String i:words) if(check(i,hs,hm)) al.add(i);\n        return al;\n    }\n    public static boolean check(String i,Set<String>hs,Map<String,Integer>hm){\n        if(hm.containsKey(i)) return hm.get(i)==1;\n        for(int z=0;z<i.length();z++){\n            if(hs.contains(i.substring(0,z))){\n                String s1=i.substring(z);\n                if(hs.contains(s1)||check(s1,hs,hm)){\n                    hm.put(i,1);\n                    return true;\n                }\n            }\n        }\n        hm.put(i,0);\n        return false;\n    }\n}\n```\nUPVOTE IF U LIKE THE APPROACH
['Depth-First Search', 'Java']