


from __future__ import annotations

from itertools import permutations
from random import randint
from timeit import repeat




def 						__SCREAMING_SNAKE_CASE       (					)		->    tuple[list[int], int]:




						'''simple docstring'''







						__UpperCAmelCase :       Any  						=  [randint(-1000			,					1000			) for i in range(10			)]
						__UpperCAmelCase :       Union[str, Any]  						=  randint(-5000			,					5000			)
						return (arr, r)


lowerCAmelCase							=						make_dataset()




def 						__SCREAMING_SNAKE_CASE       (					lowercase_			,					lowercase_			)		->    tuple[int, ...]:




						'''simple docstring'''







						for triplet in permutations(lowercase_			,					3			):
												if sum(lowercase_			) == target:
																		return tuple(sorted(lowercase_			)			)
						return (0, 0, 0)




def 						__SCREAMING_SNAKE_CASE       (					lowercase_			,					lowercase_			)		->    tuple[int, int, int]:




						'''simple docstring'''







						arr.sort()
						__UpperCAmelCase :       Tuple  						=  len(lowercase_			)
						for i in range(n - 1			):
												__UpperCAmelCase						,			__UpperCAmelCase :       Tuple  						=  i + 1, n - 1
												while left < right:
																		if arr[i] + arr[left] + arr[right] == target:
																								return (arr[i], arr[left], arr[right])
																		elif arr[i] + arr[left] + arr[right] < target:
																								left += 1
																		elif arr[i] + arr[left] + arr[right] > target:
																								right -= 1
						return (0, 0, 0)




def 						__SCREAMING_SNAKE_CASE       (					)		->    tuple[float, float]:




						'''simple docstring'''







						__UpperCAmelCase :       List[Any]  						=  '''
from __main__ import dataset, triplet_sum1, triplet_sum2
'''
						__UpperCAmelCase :       Union[str, Any]  						=  '''
triplet_sum1(*dataset)
'''
						__UpperCAmelCase :       Tuple  						=  '''
triplet_sum2(*dataset)
'''
						__UpperCAmelCase :       List[Any]  						=  repeat(setup=lowercase_			,					stmt=lowercase_			,					repeat=5			,					number=10000			)
						__UpperCAmelCase :       Union[str, Any]  						=  repeat(setup=lowercase_			,					stmt=lowercase_			,					repeat=5			,					number=10000			)
						return (min(lowercase_			), min(lowercase_			))


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

				testmod()
				lowerCAmelCase							=						solution_times()
				print(F'The time for naive implementation is {times[0]}.')
				print(F'The time for optimized implementation is {times[1]}.')





import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union




@dataclass
class        lowerCamelCase      :
	_lowerCAmelCase    :		Optional[Union[str, Path]]        =	None
	_lowerCAmelCase    :		bool        =	False
	_lowerCAmelCase    :		bool        =	False
	_lowerCAmelCase    :		bool        =	False
	_lowerCAmelCase    :		Optional[Dict]        =	None
	_lowerCAmelCase    :		Optional[str]        =	None
	_lowerCAmelCase    :		bool        =	False
	_lowerCAmelCase    :		bool        =	False
	_lowerCAmelCase    :		bool        =	False
	_lowerCAmelCase    :		bool        =	True
	_lowerCAmelCase    :		Optional[int]        =	None
	_lowerCAmelCase    :		int        =	1
	_lowerCAmelCase    :		Optional[Union[str, bool]]        =	None
	_lowerCAmelCase    :		bool        =	False
	_lowerCAmelCase    :		Optional[Dict]        =	None
	_lowerCAmelCase    :		Optional[str]        =	None


	def    A(						self):
							return self.__class__(**{k: copy.deepcopy(lowercase__) for k, v in self.__dict__.items()})

