


from collections.abc import Sequence






def 					lowerCamelCase_   (	_a     ,       _a = False	):




		"""simple docstring"""






		if not arr:
				return 0

		lowerCAmelCase__       :      Tuple   					= 0 if allow_empty_subarrays else float('''-inf'''	)
		lowerCAmelCase__       :      Dict   					= 0.0
		for num in arr:
				lowerCAmelCase__       :      Any   					= max(0 if allow_empty_subarrays else num     ,       curr_sum + num	)
				lowerCAmelCase__       :      Optional[int]   					= max(_a     ,       _a	)

		return max_sum


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

		testmod()

		lowerCamelCase						=		[-2, 1, -3, 4, -1, 2, 1, -5, 4]
		print(f'''{max_subarray_sum(nums) = }''')








def 					lowerCamelCase_   (	_a	):




		"""simple docstring"""






		if number < 0:
				raise ValueError('''number must not be negative'''	)
		return number & (number - 1) == 0


if __name__ == "__main__":
		import doctest

		doctest.testmod()




