Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created December 1, 2020 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffersGlass/d481ae8dbac18127dafa9746d5e142fe to your computer and use it in GitHub Desktop.
Save JeffersGlass/d481ae8dbac18127dafa9746d5e142fe to your computer and use it in GitHub Desktop.
def naiveFind():
data = list()
with open(file, 'r') as infile:
for line in infile:
data.append(int(line.strip('\n').strip('\r')))
for i in range(len(data)):
for j in range(i, len(data)):
if data[i] + data[j] == 2020:
success(data[i], data[j])
return
print ("Finished loop, no pairs found that sum to 2020")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment