Python - 0 additions
from itertools import repeat, countdef divide(a, b): i = repeat(0, a) try: for j in count(): for k in repeat(0, b): next(i) except: return j
This uses an iterator of length a
, and consumes it in groups of b
until StopIteration
is raised. At this point j
contains the result.