Skip to content

Commit

Permalink
Create Day 16.py
Browse files Browse the repository at this point in the history
  • Loading branch information
GJAnsah authored Apr 3, 2019
1 parent 8f17c17 commit b1e069e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Day 16.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#----Hacker Rank Array challenge : shorturl.at/egrw5


if __name__ == '__main__':
a= []

for _ in range(6):
a.append(list(map(int, input().rstrip().split())))

hourGlassSums=[]
total=[]
x=0
i=0
count=0
while count<4:
for j in range(x,x+4):
if(x+3)<7:
total.append(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])
if(len(total)==4):
hourGlassSums+=total
total=[]
i+=1
x=0
else:
x+=1
count+=1
print(max(hourGlassSums))

0 comments on commit b1e069e

Please sign in to comment.