


from collections.abc import Sequence

def       lowercase_		(		_A			:    str    ,					_A			:    Tuple = False						):

      """simple docstring"""




      if not arr:
            return 0

      lowerCamelCase__		:				Optional[Any]    =  0 if allow_empty_subarrays else float("-inf"						)
      lowerCamelCase__		:				List[str]    =  0.0
      for num in arr:
            lowerCamelCase__		:				Any    =  max(0 if allow_empty_subarrays else num    ,					curr_sum + num						)
            lowerCamelCase__		:				Optional[Any]    =  max(_lowerCAmelCase    ,					_lowerCAmelCase						)

      return max_sum


if __name__ == "__main__":
    from doctest import testmod

    testmod()

    A      :    Optional[Any]		=					[-2, 1, -3, 4, -1, 2, 1, -5, 4]
    print(f'{max_subarray_sum(nums) = }')







'''simple docstring'''





def 						__snake_case(				_lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase		)		-> float:
      snake_case__  :    str    						=      (num_of_terms / 2) * (2 * first_term + (num_of_terms - 1) * common_diff)
      # formula for sum of series
      return total





def 						__snake_case(				)		-> List[str]:
      print(sum_of_series(1     ,   1     ,   10		)		)


if __name__ == "__main__":
       import doctest

       doctest.testmod()
