Simple python solution for iterator if combination
1) Create a list of combinations using binary numbers.\n\te.g. In "abc", there are two possibilities for each character x : include it or not \n\t\t\tTherefore,
1) Create a list of combinations using binary numbers.\n\te.g. In "abc", there are two possibilities for each character x : include it or not \n\t\t\tTherefore, we may have [1,0,1] or [0,1,1] or [1,1,0] or [0,0,0] or [1,1,1],etc \n\t\t\t\n2) Check if number of ones in each possible binary list is equal to combination length or not. If yes,\n\n3) Use the indices of one in the list to produce a substring and append it to a final list\n\n4) Sort the final list \n\n5) Create an iterator and end position of list of substrings in constructor and increment it in **next** method.  \n\n6) Check if  iterator irrived at end of list in **hasNext** method\n\n\n\n\n\n```\nclass CombinationIterator:\n\n    def __init__(self, characters: str, combinationLength: int):\n        l=[]\n        chars=list(characters)\n        N=2**len(characters)\n        for i in range(N):\n            nums=list(str(bin(i)).replace(\'0b\',\'\').zfill(len(chars)))\n            if(list(nums).count(\'1\')==combinationLength):\n                ans = [int(nums[j]) * chars[j] for j in range(len(chars))]\n                final=\'\'.join(ans)\n                l.append(final)\n        l.sort()\n        self.p=l\n        self.itr=0\n        self.end=len(l)\n        \n\n    def next(self) -> str:\n        i=self.itr\n        x=self.p[i]\n        i+=1\n        self.itr=i\n        return(x)\n\n    def hasNext(self) -> bool:\n        return(self.itr<self.end)\n\n\n# Your CombinationIterator object will be instantiated and called as such:\n# obj = CombinationIterator(characters, combinationLength)\n# param_1 = obj.next()\n# param_2 = obj.hasNext()\n```
['Python3']