Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Caught the ZIGZAG *_* solution in Clear category for Zigzag Array by Stensen
def create_zigzag(rows, cols, start= 1):
if cols == 0: return [[] for _ in range(rows)]
answer = []
for idx, n in enumerate(range(start, start + rows * cols, cols)):
answer.append([*[range(n, n + cols), reversed(range(n, n + cols))][idx%2]])
return answer
Oct. 10, 2020