w, h = 5, 10 matrix = lambda w, h: [[min(x+1, w-x, y+1, h-y) for x in range(w)] for y in range(h)]# your code goes here print(matrix(w, h))
Standard input is empty
[[1, 1, 1, 1, 1], [1, 2, 2, 2, 1], [1, 2, 3, 2, 1], [1, 2, 3, 2, 1], [1, 2, 3, 2, 1], [1, 2, 3, 2, 1], [1, 2, 3, 2, 1], [1, 2, 3, 2, 1], [1, 2, 2, 2, 1], [1, 1, 1, 1, 1]]