Maximum non-negative subarray

class Solution: # @param A : list of integers # @return a list of integers def maxset(self, A): i = 0 af = [] a1 = [] while i < len(A): if A[i] >= 0: a1.append(A[i]) else: af.append(a1) a1 = [] i += 1 # Append the last subarray, if any af.append(a1) # Find a […]