If the maximum sum ending at a specific index becomes less than 0 , then making it equal to 0.
if ( max_ending_here < 0 ) : NEW_LINE INDENT max_ending_here = 0 NEW_LINE DEDENT return max_so_far NEW_LINE