Skip to content

Instantly share code, notes, and snippets.

@JeffersGlass
Created December 1, 2020 16:34
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/a33279fd7dabe5869cb7923b86e5f938 to your computer and use it in GitHub Desktop.
Save JeffersGlass/a33279fd7dabe5869cb7923b86e5f938 to your computer and use it in GitHub Desktop.
def dictFind():
seen = dict()
with open(file, 'r') as infile:
for line in infile:
num = int(line)
complement = 2020-num
if complement in seen:
success(num, complement)
return
seen[num] = True
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