Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.004 s | 9 KBi |
#2 |
Correcto
|
0.004 s | 10 KBi |
#3 |
Correcto
|
0.004 s | 7 KBi |
#4 |
Correcto
|
0.004 s | 8 KBi |
#5 |
Correcto
|
0.004 s | 10 KBi |
#6 |
Correcto
|
0.004 s | 7 KBi |
#7 |
Correcto
|
0.006 s | 9 KBi |
#8 |
Correcto
|
0.004 s | 10 KBi |
#9 |
Correcto
|
0.004 s | 19 KBi |
#10 |
Correcto
|
0.006 s | 27 KBi |
#11 |
Correcto
|
0.004 s | 31 KBi |
#12 |
Correcto
|
0.004 s | 10 KBi |
package main import "fmt" func repeatedLetter(word string) bool { var slice = make([]int,26) for _, char := range word { i := int(char) - int('a') if slice[i] == 1 { return true } slice[i] = 1 } return false } func main() { var input string fmt.Scanln(&input) if repeatedLetter(input) { fmt.Println("yes") } else { fmt.Println("no") } }