JAVA DFS
\n\nint max = Integer.MIN_VALUE;\n    \n    public int maxLength(List<String> arr) {\n        \n        dfs(arr,"",0);\n        \n        return max;\n    }\n  
```\n\nint max = Integer.MIN_VALUE;\n    \n    public int maxLength(List<String> arr) {\n        \n        dfs(arr,"",0);\n        \n        return max;\n    }\n    \n    public void dfs(List<String> arr,String res,int index){\n        \n        if(unique(res)){\n            max=Math.max(max,res.length());\n        }\n        else{\n            return;\n        }\n        \n        for(int i=index;i<arr.size();i++){\n            dfs(arr,res+arr.get(i),i+1);\n        }\n    }\n    \n    \n    public boolean unique(String res){\n        char[] ch = new char[128];\n        \n        for(int i=0;i<res.length();i++){\n            ++ch[res.charAt(i)];\n            if(ch[res.charAt(i)]>1){\n                return false;\n            }\n        }\n        return true;\n    }\n```
[]