




"""simple docstring"""






from __future__ import annotations

import typing
from collections.abc import Iterable

import numpy as np

lowercase__     						=						typing.Union[Iterable[float], Iterable[int], np.ndarray]  # noqa: UP007
lowercase__     						=						typing.Union[np.floataa, int, float]  # noqa: UP007







def      _snake_case			(				lowercase__							,    lowercase__		):
				return np.sqrt(np.sum((np.asarray(lowercase__		) - np.asarray(lowercase__		)) ** 2		)		)







def      _snake_case			(				lowercase__							,    lowercase__		):
				return sum((va - va) ** 2 for va, va in zip(lowercase__							,    lowercase__		)		) ** (1 / 2)


if __name__ == "__main__":







			def      _snake_case			(				):
							from timeit import timeit

							print('Without Numpy'		)
							print(
							    timeit(
							        'euclidean_distance_no_np([1, 2, 3], [4, 5, 6])'							,    number=10000							,    globals=globals()							,    )		)
							print('With Numpy'		)
							print(
							    timeit(
							        'euclidean_distance([1, 2, 3], [4, 5, 6])'							,    number=10000							,    globals=globals()							,    )		)
			benchmark()





"""simple docstring"""






import functools
from typing import Any







def      _snake_case			(				lowercase__							,    lowercase__		):

				# Validation
				if not isinstance(lowercase__							,    lowercase__		) or len(lowercase__		) == 0:
								raise ValueError('the string should be not empty string'		)

				if not isinstance(lowercase__							,    lowercase__		) or not all(
				    isinstance(lowercase__							,    lowercase__		) and len(lowercase__		) > 0 for item in words		):
								raise ValueError('the words should be a list of non-empty strings'		)

				# Build trie
				_lowerCamelCase     :			dict[str, Any]    =    {}
				_lowerCamelCase     :			List[Any]    =    'WORD_KEEPER'

				for word in words:
								_lowerCamelCase     :			Dict    =    trie
								for c in word:
												if c not in trie_node:
																_lowerCamelCase     :			Any    =    {}

												_lowerCamelCase     :			str    =    trie_node[c]

								_lowerCamelCase     :			Optional[Any]    =    True

				_lowerCamelCase     :			Dict    =    len(lowercase__		)

				# Dynamic programming method
				@functools.cache
				def is_breakable(lowercase__		) -> bool:
								if index == len_string:
												return True

								_lowerCamelCase     :			List[Any]    =    trie
								for i in range(lowercase__							,    lowercase__		):
												_lowerCamelCase     :			Any    =    trie_node.get(string[i]							,    lowercase__		)

												if trie_node is None:
																return False

												if trie_node.get(lowercase__							,    lowercase__		) and is_breakable(i + 1		):
																return True

								return False

				return is_breakable(0		)


if __name__ == "__main__":
			import doctest

			doctest.testmod()