Skip to content

Instantly share code, notes, and snippets.

@tjdevries
Created April 9, 2021 01:18
Show Gist options
  • Save tjdevries/d6c899d0e2052d6820904da0b8464fb7 to your computer and use it in GitHub Desktop.
Save tjdevries/d6c899d0e2052d6820904da0b8464fb7 to your computer and use it in GitHub Desktop.
Yup, get ready begin
scores = {
"!hate": -2,
"!dislike": -1,
"!like": 1,
"!love": 2,
}
from collections import defaultdict
counts = defaultdict(int)
with open("input.txt") as f:
for l in f:
s = l.strip().split(" ")
counts[s[1]] += scores[s[0]]
from collections import Counter
print(Counter(counts).most_common(1)[0][0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment