Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.133 s | 13 KBi |
#2 |
Correcto
|
0.134 s | 14 KBi |
#3 |
Correcto
|
0.119 s | 12 KBi |
#4 |
Correcto
|
0.116 s | 12 KBi |
#5 |
Correcto
|
0.087 s | 16 KBi |
#6 |
Correcto
|
0.136 s | 13 KBi |
#7 |
Correcto
|
0.195 s | 13 KBi |
#8 |
Correcto
|
0.113 s | 13 KBi |
#9 |
Correcto
|
0.151 s | 12 KBi |
#10 |
Correcto
|
0.137 s | 13 KBi |
#11 |
Correcto
|
0.142 s | 14 KBi |
#12 |
Correcto
|
0.131 s | 14 KBi |
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); final String input = scanner.next(); Set<Character> mySet = new HashSet<>(); for(int i = 0; i < input.length(); i++) { char charAt = input.charAt(i); if(mySet.contains(charAt)) { System.out.println("yes"); return; } mySet.add(charAt); } System.out.println("no"); scanner.close(); } }