Created
April 27, 2020 17:46
-
-
Save kurianbenoy/4659e765cca1144065b2462b9a4c9edf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M1 = [] | |
M2 = [] | |
def find_pairs(M1, M2, val): | |
s =set() | |
for i in range(0,1000000): | |
s.add(M1[i]) | |
for j in range(0,1000000): | |
if((val-M1[j]) in s): | |
print((val-M1[j]),M1[j]) | |
with open('million2.txt') as f: | |
for line in f: | |
line = line.strip() | |
M1.append(int(line)) | |
with open('millionnumber.txt') as f: | |
for line in f: | |
line = line.strip() | |
M2.append(int(line)) | |
print(len(M1), len(M2)) | |
#if __name__ == "__main__": | |
find_pairs(M1, M2,val=1000000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Initial observations.
Detailed comments tomorrow.