fork download
  1. f=lambda a:max(sum(x)for x in zip(a,a[1:])if 0in x)
  2.  
  3. for test in [[1,4,3,6,0,3,7,0],[9,4,9,0,9,0,9,15,-2],[-4,-6,-2,0,-9],[-11,0,0,0,0,0,-12,10],[0,20]]:
  4. print test
  5. print f(test)
  6. print ''
Success #stdin #stdout 0s 9024KB
stdin
Standard input is empty
stdout
[1, 4, 3, 6, 0, 3, 7, 0]
7

[9, 4, 9, 0, 9, 0, 9, 15, -2]
9

[-4, -6, -2, 0, -9]
-2

[-11, 0, 0, 0, 0, 0, -12, 10]
0

[0, 20]
20