题解 | #密码验证合格程序#
密码验证合格程序
http://www.nowcoder.com/practice/184edec193864f0985ad2684fbc86841
if len(s)<=8:
return 'NG'
li = [0,0,0,0]
for i in s:
if i.isdigit():
li[0]=1
elif i.islower():
li[1]=1
elif i.isupper():
li[2]=1
else:
li[3]=1
if sum(li)<3:
return "NG"
for i in range(len(s)-2):
x = s[i:i+3]
if x in s[i+3:]:
return "NG"
return "OK"
while 1:
try:
print(func(input()))
except:
break