You are viewing a single comment's thread. Return to all comments →
Python 3
def cavityMap(grid): for y in range(1, n-1): for x in range(1, n-1): row = grid[y] num = row[x] if all([num>grid[y][x-1], num>grid[y][x+1], num>grid[y-1][x], num>grid[y+1][x]]): grid[y] = row[:x]+"X"+row[x+1:] return grid
Seems like cookies are disabled on this browser, please enable them to open this website
Cavity Map
You are viewing a single comment's thread. Return to all comments →
Python 3