3 lines Python + Ruby
Python:\n\nclass CombinationIterator(object):\n\n    def __init__(self, *a):\n        combs = map(\'\'.join, itertools.combinations(*a))[::-1]\n        self.nex
Python:\n```\nclass CombinationIterator(object):\n\n    def __init__(self, *a):\n        combs = map(\'\'.join, itertools.combinations(*a))[::-1]\n        self.next = combs.pop\n        self.hasNext = lambda: bool(combs)\n```\n\nRuby:\n```\nclass CombinationIterator\n\n  def initialize(characters, combination_length)\n    @combs = characters.chars.combination(combination_length).to_a\n  end\n\n  def next()\n    @combs.shift.join\n  end\n\n  def has_next()\n    @combs.any?\n  end\n\nend\n```\nor (more like the Python one, but I don\'t really like this):\n```\nclass CombinationIterator\n  def initialize(characters, combination_length)\n    combs = characters.chars.combination(combination_length).to_a\n    define_singleton_method(:next) { combs.shift.join }\n    define_singleton_method(:has_next) { combs.any? }\n  end\nend\n```
[]