题解 | #密码验证合格程序#
密码验证合格程序
https://www.nowcoder.com/practice/184edec193864f0985ad2684fbc86841
val = 0 while True: try: passwords = input().split() for str in passwords: if len(str) <= 8: print("NG") break a,b,c,d = 0,0,0,0 for s in str: if 'a'<=s<='z': a=1 elif 'A'<=s<='Z': b=1 elif '0'<=s<='9': c=1 else: d=1 if a+b+c+d < 3: print('NG') else: for i in range(len(str)): if str[i:i+3] in str[i+3:]: print('NG') break else:print('OK') except: break