Last active
August 7, 2019 15:10
-
-
Save parzibyte/8c52482b51aa80810c5d45c6f8e3c355 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func existeEnArreglo(arreglo []int, busqueda int) int { | |
for indice, valor := range arreglo { | |
if valor == busqueda { | |
return indice | |
} | |
} | |
// -1 porque no existe | |
return -1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment