Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Zigzag Array by tokiojapan55
from typing import List
def create_zigzag(rows: int, cols: int, start: int = 1) -> List[List[int]]:
return [[(start+r*cols + ((cols-1-c) if r%2 else c)) for c in range(cols)] for r in range(rows)]
June 2, 2020
Comments: