You are viewing a single comment's thread. Return to all comments →
Imo this is compact and runs quick!
from itertools import product from string import ascii_lowercase, printable m=int(input()) d=input().split() for k in product(ascii_lowercase,repeat=3): for i in range(m): if chr(int(d[i])^ord(k[i%len(k)]))not in" ();:,.'?-"+printable[:63]: break else: print("".join(k)) break
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Project Euler #59: XOR decryption
You are viewing a single comment's thread. Return to all comments →
Imo this is compact and runs quick!