Created
January 11, 2016 21:38
-
-
Save lnds/b66007ebe19cc53a7e43 to your computer and use it in GitHub Desktop.
For y range en Go
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
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