题解 | #密码验证合格程序#
密码验证合格程序
http://www.nowcoder.com/practice/184edec193864f0985ad2684fbc86841
```def check(s):
if len(s) <= 8 :
return False
kind = [0, 0, 0, 0]
for i in s:
if i.isupper():
kind[0] = 1
elif i.islower():
kind[1] = 1
elif i.isdigit():
kind[2] = 1
else:
kind[3] = 1
if sum(kind) < 3:
return False
dic = {}
for i in range(len(s) - 3):
if s[i:i+3] not in dic:
dic[s[i:i+3]] = 1
else:
dic[s[i:i+3]] += 1
for j in dic:
if dic[j] > 1:
return False
while True:
try:
s = input()
res = check(s)
if res == False:
print('NG')
else:
print('OK')
except:
break