Anwar
BAN USERpublic class HelloWorld{
public static void main(String...args){
String s=args[0];
int a=0;
for(int i=0;i<s.length();++i){
int bit=1<<(s.charAt(i)-'a');
if((a | bit) == a){ // If there is no change after OR operation, then it's a repeatition.
System.out.println("Yes");
return;
}
a=a | bit;
}
System.out.println("No");
}
}
public static String compressed(int[] nums){
int len=nums[0];
int cons=0;
StringBuilder rst=new StringBuilder(""); // Create a compressed String
StringBuilder s=new StringBuilder(""); // To store the original string
for(int i=1;i<nums.length;++i){
cons++;
if(i+1 >= nums.length ||
(nums[i]!=nums[i+1])){
rst.append((char)nums[i]).append(cons);
cons=0;
}
s.append((char)nums[i]);
}
rst = s.length() > rst.length() ? rst : s; // If the compressed string is shorter
// return compressed string, else there
// is no use of compression(shortcoming)
return rst.toString();
}