Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.332 s | 13 KBi |
#2 |
Correcto
|
0.264 s | 12 KBi |
#3 |
Correcto
|
0.265 s | 12 KBi |
#4 |
Correcto
|
0.127 s | 20 KBi |
#5 |
Correcto
|
0.346 s | 13 KBi |
#6 |
Correcto
|
0.138 s | 12 KBi |
#7 |
Correcto
|
0.248 s | 12 KBi |
#8 |
Correcto
|
0.117 s | 12 KBi |
#9 |
Correcto
|
0.124 s | 15 KBi |
#10 |
Correcto
|
0.139 s | 12 KBi |
#11 |
Correcto
|
0.268 s | 14 KBi |
#12 |
Correcto
|
0.243 s | 12 KBi |
import java.util.Hashtable; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String palabra = scanner.nextLine(); String result = "no"; if(palabra.length() > 26) { result = "yes"; } else { Hashtable<Character, Boolean> hash = new Hashtable<>(); char caracter; for(int i = 0; i < palabra.length(); i++) { caracter = palabra.charAt(i); if(hash.containsKey(caracter)) { result = "yes"; break; }else { hash.put(palabra.charAt(i), false); } } } System.out.println(result); } }