

"""simple docstring"""






from __future__ import annotations

import time
from collections.abc import Sequence
from random import randint

from matplotlib import pyplot as plt



def   lowercase_	(    _lowercase       :		Sequence[float]							,      _lowercase       :		int							,      _lowercase       :		int	):




					'''simple docstring'''






					if not arr:
										return None, None, 0
					if low == high:
										return low, high, arr[low]

					UpperCAmelCase			:   List[str]      =				(low + high) // 2
					UpperCAmelCase			:   List[Any]      =				max_subarray(_lowercase							,      _lowercase							,      _lowercase	)
					UpperCAmelCase			:   Any      =				max_subarray(_lowercase							,      mid + 1							,      _lowercase	)
					UpperCAmelCase			:   int      =				max_cross_sum(_lowercase							,      _lowercase							,      _lowercase							,      _lowercase	)
					if left_sum >= right_sum and left_sum >= cross_sum:
										return left_low, left_high, left_sum
					elif right_sum >= left_sum and right_sum >= cross_sum:
										return right_low, right_high, right_sum
					return cross_left, cross_right, cross_sum



def   lowercase_	(    _lowercase       :		Sequence[float]							,      _lowercase       :		int							,      _lowercase       :		int							,      _lowercase       :		int	):




					'''simple docstring'''






					UpperCAmelCase			:   Optional[int]      =				float("-inf"	), -1
					UpperCAmelCase			:   int      =				float("-inf"	), -1

					UpperCAmelCase			:   int | float      =				0
					for i in range(_lowercase							,      low - 1							,      -1	):
										summ += arr[i]
										if summ > left_sum:
															UpperCAmelCase			:   Any      =				summ
															UpperCAmelCase			:   Dict      =				i

					UpperCAmelCase			:   Dict      =				0
					for i in range(mid + 1							,      high + 1	):
										summ += arr[i]
										if summ > right_sum:
															UpperCAmelCase			:   Optional[int]      =				summ
															UpperCAmelCase			:   List[Any]      =				i

					return max_left, max_right, (left_sum + right_sum)



def   lowercase_	(    _lowercase       :		int	):




					'''simple docstring'''






					UpperCAmelCase			:   str      =				[randint(1							,      _lowercase	) for _ in range(_lowercase	)]
					UpperCAmelCase			:   List[str]      =				time.time()
					max_subarray(_lowercase							,      0							,      input_size - 1	)
					UpperCAmelCase			:   List[str]      =				time.time()
					return end - start



def   lowercase_	(    ):




					'''simple docstring'''






					UpperCAmelCase			:   str      =				[10, 1_00, 10_00, 1_00_00, 5_00_00, 10_00_00, 20_00_00, 30_00_00, 40_00_00, 50_00_00]
					UpperCAmelCase			:   Optional[int]      =				[time_max_subarray(_lowercase	) for input_size in input_sizes]
					print("No of Inputs\t\tTime Taken"	)
					for input_size, runtime in zip(_lowercase							,      _lowercase	):
										print(_lowercase							,      "\t\t"							,      _lowercase	)
					plt.plot(_lowercase							,      _lowercase	)
					plt.xlabel("Number of Inputs"	)
					plt.ylabel("Time taken in seconds"	)
					plt.show()


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

	testmod()









"""simple docstring"""






def   lowercase_	(    _lowercase       :		int							,      _lowercase       :		int	):




					'''simple docstring'''






					return int(input_a == input_a == 0	)



def   lowercase_	(    ):




					'''simple docstring'''






					print("Truth Table of NOR Gate:"	)
					print("|   Input 1   |  Input 2  | Output |"	)
					print(F"""|      0      |    0      |  {nor_gate(0							,      0	)}     |"""	)
					print(F"""|      0      |    1      |  {nor_gate(0							,      1	)}     |"""	)
					print(F"""|      1      |    0      |  {nor_gate(1							,      0	)}     |"""	)
					print(F"""|      1      |    1      |  {nor_gate(1							,      1	)}     |"""	)


if __name__ == "__main__":
	import doctest

	doctest.testmod()
	main()


