Skip to content

Commit 60e5445

Browse files
author
Anandkarthick
authoredJan 20, 2018
Add files via upload
1 parent 62b7da5 commit 60e5445

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
 

‎hourglass copy.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/python3
2+
3+
import sys
4+
5+
6+
a = []
7+
for arr_i in range(6):
8+
arr_t = [int(arr_temp) for arr_temp in input().strip().split(' ')]
9+
a.append(arr_t)
10+
11+
sumslist = []
12+
13+
def calculatesum(i,j):
14+
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])
15+
16+
for j in range(0,4):
17+
for i in range(0,4):
18+
sum = calculatesum(i,j)
19+
sumslist.append(sum)
20+
21+
print(max(sumslist))

0 commit comments

Comments
 (0)
Please sign in to comment.