Here is the python solution


#1

class Solution:
def maxset(self, a):
s=0
i=0
m=[]
l=[]
maxi=a[0]
while i< len(a):
if a[i]<0:
s=0
m=[]
else:
s+=a[i]
m.append(a[i])
if s>maxi:
maxi=s
l=m
if s==maxi:
if len(l)<len(m):
l=m
i+=1
return l