Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Zigzag Array by yoichi
from typing import List
def create_zigzag(rows: int, cols: int, start: int = 1) -> List[List[int]]:
return [sorted(list(range(start + n * cols, start + (n + 1) * cols)),
reverse=n%2) for n in range(rows)]
Nov. 5, 2018
Comments: