import java.util.*;
class Main
{
public static boolean hasUniqueChars
(String toTest
) {
char charArray[] = toTest.toCharArray();
for (int x = 1; x < charArray.length; x++)
{
if ( charArray[x] == charArray[x-1] )
return false;
}
return true;
}
public static void main
(String args
[]) {
"abc",
"abcc",
"abcdefhi",
"abcdefhiabcdefhi",
"ccc",
"xxxkjsdfkjqqqdkjfd",
"abcdefghijklmnopqrstuvwxyz",
};
{
if ( hasUniqueChars(test) )
{
System.
out.
println(" hasUniqueChars(\"" + test
+ "\")"); }
else
{
System.
out.
println("! hasUniqueChars(\"" + test
+ "\")"); }
}
}
}
// vim: sw=4:ts=4:sts=4:et:ai: