Simple Java HashSet Solution O(n+k)
Code\n\nclass Solution {\n    public int countConsistentStrings(String allowed, String[] words) {\n        HashSet<Character> set = new HashSet<>();\n        in
# Code\n```\nclass Solution {\n    public int countConsistentStrings(String allowed, String[] words) {\n        HashSet<Character> set = new HashSet<>();\n        int total = words.length;\n\n        for(char c: allowed.toCharArray()){\n            set.add(c);\n        }\n        \n        for(String str: words){\n            for(char c: str.toCharArray()){\n                if(!set.contains(c)){\n                    total--;\n                    break;\n                }\n            }\n        }\n\n        return total;\n    }\n}\n```
['Java']