<jupyter_start><jupyter_text>Ejercicio 04¿Cuál es la complejidad temporal en terminos de $O( )$?<jupyter_code># 3. What is the time complexity in terms of 0()?

def find_needle(needle,haystack):
# Dado dos conjuntos de valores, la función nos retorna
# verdadero si los valores de needle se encuentran dentro
# de los valores de haystack, sino retornará falso
	needle_index = 0
	haystack_index = 0

	while haystack_index < len(haystack):
		if needle[needle_index] == haystack[haystack_index]:
			found_needle = True
			while needle_index < len(needle):
				if needle[needle_index] != haystack[haystack_index + needle_index]:
					found_needle = False
				break
				needle_index += 1
		return True
		if found_needle:
			needle_index = 0
		haystack_index += 1
	return False
array1 = ["f", "g", "h"]
array2 = ["a", "b", "c", "d", "e", "f", "g", "h", "i"]
find_needle(array1, array2)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11661166116611661, 'fraction_numerical': 0.014301430143014302, 'mean_word_length': 4.796178343949045, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '615361', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 378, 'n_tokens_neox': 334, 'n_words': 99, 'path': 'Aula04_19_10_2021/Lab04Ejercicio04.ipynb', 'repo_name': 'RolandoLeonM/LabADAGrupoC', 'size': '909'}