Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
4-liner: range it solution in Clear category for Zigzag Array by przemyslaw.daniel
def create_zigzag(rows, cols, start=1):
zigzag = range(cols), range(cols-1, -1, -1)
return [[start+x+y*cols for x in zigzag[y % 2]]
for y in range(rows)]
Oct. 15, 2018