Java✔️Clean Solution🔥||🔥Daily Challenges🔥
Complexity\n- Time complexity:O(n^2)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(n)\n Add your space complexity here, e.g. O(n) \n\n# IT
# Complexity\n- Time complexity:$$O(n^2)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# ITERATIVE APPROACH(NIVE SOLUTION)\n**20% Beats in JAVA**\n```\nclass Solution {\n    private boolean helper(String s) {\n        Set<Character> set = new HashSet<>();\n        for (char ch : s.toCharArray()) {\n            if (!set.add(ch))\n                return false;\n        }\n        return true;\n    }\n\n    public int maxLength(List<String> arr) {\n        List<String> list = new ArrayList<>();\n        list.add("");\n\n        int res = 0;\n        for (String word : arr) {\n            for (int i = 0; i < list.size(); i++) {\n                String newword = list.get(i) + word;\n\n                if (helper(newword)) {\n                    list.add(newword);\n                    res = Math.max(res, newword.length());\n                }\n            }\n        }\n\n        return res;\n    }\n}\n```\n\n---\n\n\n# BACKTRACKIG + ARRAY APPROACH\n**80% Beats in Java**\n```\nclass Solution {\n    private void backTrack(List<String> arr, String curr, int start, int[] length) {\n        // base Case\n        if (length[0] < curr.length()) {\n            length[0] = curr.length();\n        }\n\n        // String Iteration\n        for (int i = start; i < arr.size(); i++) {\n            if (!helper(curr, arr.get(i))) {\n                continue;\n            }\n\n            backTrack(arr, curr + arr.get(i), i + 1, length); // backtracking...\n        }\n    }\n\n    private boolean helper(String s1, String s2) {\n        Set<Character> set = new HashSet<>();\n        for (char ch : s2.toCharArray()) {\n            if (set.contains(ch))\n                return false;\n            set.add(ch);\n\n            if (s1.contains(String.valueOf(ch)))\n                return false;\n        }\n        return true;\n    }\n\n    public int maxLength(List<String> arr) {\n    // Backtracking Solution\n        int[] length = {0};\n        backTrack(arr, "", 0, length);\n        return length[0];\n    }\n}\n```
['Array', 'String', 'Backtracking', 'Bit Manipulation', 'Java']