Skip to content

Commit

Permalink
modify algo to check dups across files for 64 dup output
Browse files Browse the repository at this point in the history
  • Loading branch information
coetry committed Mar 1, 2019
1 parent d2c1fc7 commit 423d67c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions names/names.py
Expand Up @@ -11,12 +11,20 @@
f.close()

# merge names to single list
names = names_1 + names_2
# names = names_1 + names_2

duplicates = set()
duplicates = set()
# counter dict to keep track of previously encountered names
counter = {}

for name in names_1:
counter[name] = 1

for name in names_2:
if name in counter:
duplicates.add(name)

"""
for name in names:
# if name isn't in dict, initialize key to value of 1
if not name in counter:
Expand All @@ -26,6 +34,7 @@
else:
counter[name] += 1
duplicates.add(name)
"""

end_time = time.time()

Expand Down

0 comments on commit 423d67c

Please sign in to comment.