Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.131 s | 16 KBi |
#2 |
Correcto
|
0.121 s | 16 KBi |
#3 |
Correcto
|
0.136 s | 15 KBi |
#4 |
Correcto
|
0.144 s | 15 KBi |
#5 |
Correcto
|
0.294 s | 53 KBi |
#6 |
Correcto
|
0.132 s | 15 KBi |
#7 |
Correcto
|
0.151 s | 16 KBi |
#8 |
Correcto
|
0.13 s | 16 KBi |
#9 |
Correcto
|
0.141 s | 15 KBi |
#10 |
Correcto
|
0.149 s | 15 KBi |
#11 |
Correcto
|
0.132 s | 15 KBi |
#12 |
Correcto
|
0.148 s | 16 KBi |
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sn = new Scanner(System.in); String word = sn.nextLine(); Map<Character, Integer> counter = new HashMap<>(); for (int i = 0; i < word.length(); i++) { counter.putIfAbsent(word.charAt(i), i); } String response = counter.size() != (word.length()) ? "yes" : "no"; System.out.println(response); } }