Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Anandkarthick authored Jan 20, 2018
1 parent 62b7da5 commit 60e5445
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions hourglass copy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/python3

import sys


a = []
for arr_i in range(6):
arr_t = [int(arr_temp) for arr_temp in input().strip().split(' ')]
a.append(arr_t)

sumslist = []

def calculatesum(i,j):
return(a[i][j] + a[i][j+1] + a[i][j+2] + a[i+1][j+1] + a[i+2][j] + a[i+2][j+1] + a[i+2][j+2])

for j in range(0,4):
for i in range(0,4):
sum = calculatesum(i,j)
sumslist.append(sum)

print(max(sumslist))

0 comments on commit 60e5445

Please sign in to comment.