Skip to content

Commit

Permalink
Merge pull request #1 from Anandkarthick/Anandkarthick-patch-1
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
Anandkarthick committed Jan 20, 2018
2 parents 8445f90 + 76db964 commit 62b7da5
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions hourglass.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 62b7da5

Please sign in to comment.