JAVA Solution Explained in HINDI
https://youtu.be/Z0-cQY3GwBE\n\nFor explanation, please watch the above video and do like, share and subscribe the channel. \u2764\uFE0F\n\nSubscribe link:- htt
https://youtu.be/Z0-cQY3GwBE\n\nFor explanation, please watch the above video and do like, share and subscribe the channel. \u2764\uFE0F\n\nSubscribe link:- https://youtube.com/@quantumCode7?si=NzjWYmiCbqfFBUJE\n\nSubscribe Goal:- 100\nCurrent Subscriber:- 70\n\n# Code\n```\nclass Solution {\n    public int maxLength(List<String> arr) {\n        return solve(0, arr, "");\n    }\n\n    public int solve(int index, List<String> arr, String input) {\n\n        if(index == arr.size()) {\n            if (isValid(input)) {\n                return input.length();\n            }\n            return 0;\n        }\n        int take = solve(index+1, arr, input+arr.get(index));\n        int notTake = solve(index+1, arr, input);\n        return Math.max(take, notTake);\n    }\n\n    public boolean isValid(String s) {\n        int freq[] = new int[26];\n        for(int i = 0; i < s.length(); i++) {\n            int val = s.charAt(i) - \'a\';\n            freq[val]++;\n            if(freq[val] > 1) return false;\n        }\n        return true;\n    } \n}\n```
['Java']