Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.086 s | 57 KBi |
#2 |
Correcto
|
0.125 s | 35 KBi |
#3 |
Correcto
|
0.118 s | 53 KBi |
#4 |
Correcto
|
0.14 s | 13 KBi |
#5 |
Correcto
|
0.137 s | 12 KBi |
#6 |
Correcto
|
0.227 s | 44 KBi |
#7 |
Correcto
|
0.138 s | 13 KBi |
#8 |
Correcto
|
0.08 s | 16 KBi |
#9 |
Correcto
|
0.191 s | 14 KBi |
#10 |
Correcto
|
0.138 s | 22 KBi |
#11 |
Correcto
|
0.159 s | 22 KBi |
#12 |
Correcto
|
0.135 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<>(); char[] myChars = input.toCharArray(); Arrays.sort(myChars); for(int i = 0; i < myChars.length; i++) { char charAt = myChars[i]; if(mySet.contains(charAt)) { System.out.println("yes"); return; } mySet.add(charAt); } System.out.println("no"); scanner.close(); } }