A super gross unreadable solution but fun none the less 😂
def score(inp): def single_score(n, c): return (n * (100 if n != 1 else 1000) if c >= 3 and n in t else 0) + ((n * (10 if n != 1 else 100)) * (c - (3 if c >= 3 else 0)) if n in s else 0) return sum([single_score(n, c) for n, c in {i: inp.count(i) for i in inp}.items()]) score([2, 4, 4, 5, 4]) # 450
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A super gross unreadable solution but fun none the less 😂