Another Python Solution


#1
    def maxset(self, A):
        return_arr = []
        for i in range(len(A)):
            candidate_arr = []
            while i < len(A) and A[i] >= 0:
                candidate_arr.append(A[i])
                i = i + 1
            if not return_arr or sum(return_arr) < sum(candidate_arr): 
                return_arr = candidate_arr
        return return_arr