Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.184 s | 12 KBi |
#2 |
Correcto
|
0.17 s | 16 KBi |
#3 |
Correcto
|
0.167 s | 16 KBi |
#4 |
Correcto
|
0.168 s | 15 KBi |
#5 |
Correcto
|
0.175 s | 12 KBi |
#6 |
Correcto
|
0.172 s | 12 KBi |
#7 |
Correcto
|
0.168 s | 16 KBi |
#8 |
Correcto
|
0.158 s | 16 KBi |
#9 |
Correcto
|
0.158 s | 16 KBi |
#10 |
Correcto
|
0.157 s | 16 KBi |
#11 |
Correcto
|
0.174 s | 12 KBi |
#12 |
Correcto
|
0.132 s | 12 KBi |
import java.util.Scanner; /** * * @author usuario */ public class Main { public static void main(String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); String word = sc.nextLine(); boolean[] letters = new boolean[128]; String result = "no"; for(int i=0; i<word.length();i++){ int item = word.charAt(i); if(letters[item]){ result = "yes"; break; }else{ letters[item] = true; } } System.out.println(result); } }