You are viewing a single comment's thread. Return to all comments →
Python 3 one liner:
print(max([sum([*arr[i][j:j+3],*arr[i+2][j:j+3],arr[i+1][j+1]]) for j in range(4) for i in range(4)]))
Seems like cookies are disabled on this browser, please enable them to open this website
Day 11: 2D Arrays
You are viewing a single comment's thread. Return to all comments →
Python 3 one liner:
print(max([sum([*arr[i][j:j+3],*arr[i+2][j:j+3],arr[i+1][j+1]]) for j in range(4) for i in range(4)]))