Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.147 s | 12 KBi |
#2 |
Incorrecto
|
0.197 s | 12 KBi |
#3 |
Incorrecto
|
0.156 s | 12 KBi |
#4 |
Incorrecto
|
0.132 s | 13 KBi |
#5 |
Incorrecto
|
0.166 s | 12 KBi |
#6 |
Incorrecto
|
0.152 s | 12 KBi |
#7 |
Incorrecto
|
0.129 s | 12 KBi |
#8 |
Incorrecto
|
0.156 s | 12 KBi |
#9 |
Incorrecto
|
0.234 s | 12 KBi |
#10 |
Incorrecto
|
0.143 s | 12 KBi |
#11 |
Incorrecto
|
0.132 s | 12 KBi |
#12 |
Incorrecto
|
0.159 s | 12 KBi |
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String palabra = ""; char[] letras; int repetir = 0; palabra = sc.nextLine(); letras = palabra.toCharArray(); for (int i = 0; i < letras.length; i++) { char letraActual = letras[i]; int cont = 0; System.out.println(letraActual); for(int j = 0; j < letras.length; j++) { if(letras[j] == letraActual) cont++; } if(repetir < cont) { repetir = cont; } } if (repetir !=1) { System.out.println("yes"); }else { System.out.println("no"); } } }