Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.09 s | 16 KBi |
#2 |
Correcto
|
0.099 s | 16 KBi |
#3 |
Correcto
|
0.096 s | 13 KBi |
#4 |
Correcto
|
0.104 s | 13 KBi |
#5 |
Correcto
|
0.091 s | 16 KBi |
#6 |
Correcto
|
0.093 s | 16 KBi |
#7 |
Correcto
|
0.093 s | 16 KBi |
#8 |
Correcto
|
0.098 s | 13 KBi |
#9 |
Correcto
|
0.09 s | 16 KBi |
#10 |
Correcto
|
0.075 s | 17 KBi |
#11 |
Correcto
|
0.1 s | 16 KBi |
#12 |
Correcto
|
0.092 s | 16 KBi |
import java.util.*; public class Main { public static void main(String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); String word = sc.nextLine(); System.out.println(isRepeated(word)); } public static String isRepeated(String word){ int [] letters = new int[26]; for(Character c: word.toCharArray()){ if(letters[c-'a']>0) return "yes"; letters[c-'a']++; } return "no"; } }