Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
bit brute solution in Clear category for Painting Wall by StefanPochmann
def checkio(required, operations):
X = sorted({x for s, e in operations for x in {s, e+1}})
for n in range(1, len(operations) + 1):
if sum(e-s for s, e in zip(X, X[1:])
if any(S<=s= required:
return n
return -1
Jan. 21, 2016