Simple Python vs. efficient Python.
While this one-line sollution represents idiomatic Python it is vastly inefficient.\n\nclass Solution:\n    def countConsistentStrings(self, allowed: str, words
While this one-line sollution represents idiomatic Python it is vastly inefficient.\n```\nclass Solution:\n    def countConsistentStrings(self, allowed: str, words: List[str]) -> int:\n\t\n        return len([word for word in words if set(word).issubset(allowed)])\n```\nThe following solution is more verbose but much more performant for the following reasons.\n1. Allowed is converted to a set only once.\n2. Each word is **NOT** converted to a set. \n3. Word consistency fails on the first non-matching character.\n4. Integer kept to represent number of consistent words instead of a list of consistent words.\n```\nclass Solution:\n    def countConsistentStrings(self, allowed: str, words: List[str]) -> int:\n        \n        consistent, allowed = 0, set(allowed)\n        for word in words:\n            for l in word:\n                if l not in allowed:\n                    break\n            else:\n                consistent += 1\n        return consistent\n```
[]