|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- # -------
- # imports
- # -------
- from string import ascii_letters
-
- # ---------
- # constants
- # ---------
-
- DEBUG=True
-
- # ----------------
- # helper functions
- # ----------------
-
- def debug(*args):
- if DEBUG:
- print(args)
-
- # -------------
- # main function
- # -------------
-
- def main():
- with open("input6.txt", "r") as file:
- intext = file.read()
-
- inlen = len(intext)
-
- for i in range(inlen):
- lets = []
- for j in range(14):
- clet = intext[i+j]
- lets.append(clet)
-
- if len(set(lets)) != 14:
- print(f"Non-unique: {''.join(lets)} in {i+1}-{i+14}")
- else:
- print(f"Unique! {''.join(lets)} in {i+1}-{i+14}")
- break
-
- # --------------
- # run the script
- # --------------
-
- if __name__ == "__main__":
- main()
|