This code calculates the maximum sum of an hourglass in a 2D array. An hourglass in a 2D array is a set of 7 numbers arranged in the following pattern: a b c d e f g ...
for i in range(len(arr)-2): for j in range(len(arr)-2): b = arr[i][j]+arr[i][j+1]+arr[i][j+2]+ arr[i+1][j+1] + arr[i+2][j]+ arr[i+2][j+1]+ arr[i+2][j+2] print('\n ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する