1
impl Solution {
2
pub fn strong_password_checker_ii(password: String) -> bool {
3
if password.len() < 8 {
4
return false;
5
}
6

7
let mut res = 0;
8
let mut prev_char = ' ';
9
for c in password.chars() {
10
match c == prev_char {
11
true => return false,
12
_ if c.is_ascii_lowercase() => res |= 0b1,
13
_ if c.is_ascii_uppercase() => res |= 0b10,
14
_ if c.is_ascii_digit() => res |= 0b100,
15
_ => res |= 0b1000, // "!@#$%^&*()-+"
16
}
17
prev_char = c;
18
}
19
res == 0b1111
20
}
21
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0