1
# Runtime: 65 ms (Top 11.66%) | Memory: 13.9 MB (Top 19.37%)
2

3

4
class Solution:
5
def strongPasswordCheckerII(self, pwd: str) -> bool:
6
return (
7
len(pwd) > 7
8
and max(len(list(p[1])) for p in groupby(pwd)) == 1
9
and reduce(
10
lambda a, b: a
11
| (1 if b.isdigit() else 2 if b.islower() else 4 if b.isupper() else 8),
12
pwd,
13
0,
14
)
15
== 15
16
)

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0