[Python] Fast and simple solution (not built-in)
Runtime: 44 ms, faster than 91.21% of Python3 online submissions.\n\nMemory Usage: 15.1 MB, less than 100.00% of Python3 online submissions.\n\n\nclass Combinat
Runtime: 44 ms, faster than 91.21% of Python3 online submissions.\n\nMemory Usage: 15.1 MB, less than 100.00% of Python3 online submissions.\n\n```\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        self.c = characters\n        self.n = combinationLength\n        self.i = 0\n        self.ans = []\n        self.permute(\'\', 0)\n\n\n    def permute(self, s, start):\n        if len(s) == self.n:\n            self.ans.append(s)\n\t\t\treturn\n        else:\n            for i in range(start, len(self.c)):\n                self.permute(s + self.c[i], i + 1)\n\n\n    def next(self) -> str:\n        ans = self.ans[self.i]\n        self.i += 1\n        return ans\n\n\n    def hasNext(self) -> bool:\n        return self.i < len(self.ans)\n```\n
['Python']