We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int the book,the code is: if (str.length() > 26) { return false; } it's contains only the lowercase a to z characters.
but on github,the code is:
if (str.length() > 128) { return false; }
it's contains all ASCII.
public static boolean isUniqueChars(String str) { if (str.length() > 128) { return false; } int checker = 0; for (int i = 0; i < str.length(); i++) { int val = str.charAt(i) - 'a'; System.out.println(val); if ((checker & (1 << val)) > 0) return false; checker |= (1 << val); } return true; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
int the book,the code is:
if (str.length() > 26) {
return false;
}
it's contains only the lowercase a to z characters.
but on github,the code is:
if (str.length() > 128) {
return false;
}
it's contains all ASCII.
public static boolean isUniqueChars(String str) {
if (str.length() > 128) {
return false;
}
int checker = 0;
for (int i = 0; i < str.length(); i++) {
int val = str.charAt(i) - 'a';
System.out.println(val);
if ((checker & (1 << val)) > 0) return false;
checker |= (1 << val);
}
return true;
}
The text was updated successfully, but these errors were encountered: