Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Zigzag Array by kazuki.h
from typing import List
def create_zigzag(rows: int, cols: int, start: int = 1) -> List[List[int]]:
return [[start + i + cols * j for i in range(cols)][::(-1) ** j] for j in range(rows)]
March 23, 2020