Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Last active August 7, 2019 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/8c52482b51aa80810c5d45c6f8e3c355 to your computer and use it in GitHub Desktop.
Save parzibyte/8c52482b51aa80810c5d45c6f8e3c355 to your computer and use it in GitHub Desktop.
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