Skip to content

Instantly share code, notes, and snippets.

@scottnguyen
Created June 9, 2015 03:16
Show Gist options
  • Save scottnguyen/89deb74b35cbcf2baedd to your computer and use it in GitHub Desktop.
Save scottnguyen/89deb74b35cbcf2baedd to your computer and use it in GitHub Desktop.
homework stuff
public String checkPassword(String password){
//... your previous logic
for (int i = 0 ; i < password.length - 3; i++) {
if (password.charAt(i) == password.charAt(i+1) && password.charAt(i) == password.charAt(i+2)) {
result = "invalid";
}
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment