Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.083 s | 16 KBi |
#2 |
Correcto
|
0.075 s | 16 KBi |
#3 |
Correcto
|
0.077 s | 16 KBi |
#4 |
Correcto
|
0.099 s | 16 KBi |
#5 |
Correcto
|
0.073 s | 16 KBi |
#6 |
Correcto
|
0.079 s | 16 KBi |
#7 |
Correcto
|
0.076 s | 16 KBi |
#8 |
Correcto
|
0.083 s | 16 KBi |
#9 |
Correcto
|
0.082 s | 16 KBi |
#10 |
Correcto
|
0.08 s | 16 KBi |
#11 |
Correcto
|
0.08 s | 16 KBi |
#12 |
Correcto
|
0.079 s | 16 KBi |
import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String word = scanner.nextLine(); char[] charArray = word.toCharArray(); HashMap<Character, Boolean> memoization = new HashMap<>(); for(int i=0; i<=charArray.length; i++){ if(i == charArray.length){ System.out.println("no"); break; } if(!memoization.containsKey(charArray[i])){ memoization.put(charArray[i], true); } else { System.out.println("yes"); break; } } } }