
"""simple docstring"""



def lowerCamelCase_				(     _lowerCamelCase			:	List[str]					,				_lowerCamelCase			:	Optional[int]					,				_lowerCamelCase			:	Dict					,				_lowerCamelCase			:	Tuple					,				_lowerCamelCase			:	Optional[Any]				):
       if index == number_of_items:
              return 0
       lowerCamelCase_       							=		0
       lowerCamelCase_       							=		0
       lowerCamelCase_       							=		knapsack(snake_case__					,				snake_case__					,				snake_case__					,				snake_case__					,				index + 1				)
       if weights[index] <= max_weight:
              lowerCamelCase_       							=		values[index] + knapsack(
                  snake_case__					,				snake_case__					,				snake_case__					,				max_weight - weights[index]					,				index + 1				)
       return max(snake_case__					,				snake_case__				)


if __name__ == "__main__":
 import doctest

 doctest.testmod()





"""simple docstring"""




from collections.abc import Sequence



def        a__					(							snake_case__			,					snake_case__ = False							)		->   float:
			if not arr:
						return 0

			lowerCamelCase      =   0 if allow_empty_subarrays else float("""-inf"""							)
			lowerCamelCase      =   0.0
			for num in arr:
						lowerCamelCase      =   max(0 if allow_empty_subarrays else num			,					curr_sum + num							)
						lowerCamelCase      =   max(snake_case__			,					snake_case__							)

			return max_sum


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

					testmod()

					lowerCAmelCase				:     Union[str, Any]					=				[-2, 1, -3, 4, -1, 2, 1, -5, 4]
					print(F"""{max_subarray_sum(nums) = }""")



