Skip to content

Instantly share code, notes, and snippets.

@lnds
Created January 11, 2016 21:38
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 lnds/b66007ebe19cc53a7e43 to your computer and use it in GitHub Desktop.
Save lnds/b66007ebe19cc53a7e43 to your computer and use it in GitHub Desktop.
For y range en Go
num := make([]int, 0, tam)
for i, c := range accion {
if !unicode.IsDigit(c) {
return nil
} else if i >= tam {
return nil
} else {
digit := int (c - '0')
for _, d := range num {
if digit == d { return nil }
}
num = num[0:i+1]
num[i] = digit
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment