Java | Simple | 10 lines | Clean code
Complexity\n- Time complexity: O(m+n\u22C5k)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n)
# Complexity\n- Time complexity: $$O(m+n\u22C5k)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n  public int countConsistentStrings(String allowed, String[] words) {\n    var map = new boolean[26];\n    var res = words.length;\n\n    for (var c : allowed.toCharArray())\n      map[c - \'a\'] = true;\n\n    for (var word : words) {\n      for (var c : word.toCharArray()) {\n        if (!map[c - \'a\']) {\n          res--;\n          break;\n        }\n      }\n    }\n    return res;\n  }\n}\n```\nIf you like my solution, please upvote it!
['Array', 'String', 'Counting', 'Java']