Simple Solution | 100 % Beats | Java ✅
\n\n# Code\njava []\nclass Solution {\n    public int countConsistentStrings(String allowed, String[] words) {\n        boolean present[] = new boolean[123];\n 
> ![Screenshot 2024-09-12 115105.png](https://assets.leetcode.com/users/images/ec413e8a-80b9-4f85-98ee-a481daee1991_1726122118.836193.png)\n\n# Code\n```java []\nclass Solution {\n    public int countConsistentStrings(String allowed, String[] words) {\n        boolean present[] = new boolean[123];\n        for(char ch : allowed.toCharArray()) {\n            present[ch] = true;\n        }\n        int result = 0;\n        for(String str : words) {\n            if(check(str, present)) result++;\n        }\n        return result;\n    }\n    boolean check(String str, boolean[] present) {\n        for(int i = 0; i < str.length(); i++) {\n            if(present[str.charAt(i)] == false) return false;\n        }\n        return true;\n    }\n}\n```
['Java']