Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Greedy solution in Uncategorized category for Auto Painting by gflegar
def checkio(capacity, number):
new, half, done, res = number, 0, 0, ""
while half or new:
n = min(new, capacity)
o = min(half, capacity - n)
res += "".join([str(done + i) for i in range(o)] + [str(done + half + i) for i in range(n)]) + ','
done, half, new = done + o, half + n - o, new - n
return res[:-1]
Jan. 27, 2014
Comments: