Python solution : EXPLAINED : with fastest in time(90%) and lowest(99.5%) in space.
\n\n\nIn this problem we have to go through the list at least once to get to every element and check whether that is consistent or not. Also for every element(w
![image](https://assets.leetcode.com/users/images/0341cf64-7616-4259-bd4c-823e6b31add6_1626667240.640256.jpeg)\n\n\nIn this problem we have to go through the list at least once to get to every element and check whether that is consistent or not. Also for every element(word) in list we have to check every character and confirm if it is allowed or not.\n\nSo Brute force approach takes around O(n x len(word)) for time complexity. And the space complexity is O(1).\n\nWe can trade off space complexity to reduce time complexity a little bit by using set operations.\n\n```\nclass Solution:\n    def countConsistentStrings(self, allowed: str, words: List[str]) -> int:\n        \n        """Brute Force\n        Time complexity : O(n*m) where m = max(len(word) in words)\n        Space complexity: O(1)\n        """\n        \n        count = 0\n         for word in words:\n             for ch in word:\n                 if ch not in allowed:\n                     count += 1\n                     break\n\n         return len(words)-count\n        \n\t\t\n\t\t\n        """One liner\n        Set operation\n\n        """\n        return sum(not set(word)-set(allowed) for word in words)\n\n\n\t\t"""Set operation by subset operation\n\t\tNOTE : SPACE COMPLEXITY INCREASES IN THIS APPROACH.\n\t\t"""\n\t\tallowed = set(allowed)\n\t\tn = 0\n\t\tfor w in words:\n\t\t\tif set(w).issubset(allowed):\n\t\t\t\tn += 1\n\t\treturn n\n```
['Python', 'Python3']