24 lines
749 B
Python
Executable File
24 lines
749 B
Python
Executable File
#!/usr/bin/env python3
|
|
# passphrase validity checker. see file `notes` for details
|
|
# only strings with NO DUPLICATE words are valid
|
|
|
|
if __name__ == '__main__':
|
|
total_valid = 0
|
|
|
|
def check_for_duplicates(list):
|
|
has_duplicate = False
|
|
for i in range(1, len(list)):
|
|
for j in range(i):
|
|
if list[i] == list[j]:
|
|
has_duplicate = True
|
|
return has_duplicate
|
|
|
|
with open("input", "r", encoding="utf-8") as passphrase_input:
|
|
for passphrase in passphrase_input:
|
|
is_valid = False
|
|
passwords = passphrase.split()
|
|
is_valid = not check_for_duplicates(passwords)
|
|
if is_valid:
|
|
total_valid += 1
|
|
print(total_valid)
|