Hacker News new | past | comments | ask | show | jobs | submit login

Or this (not efficient but fun, and using a dict comprehension and no itertools):

    {a: sum(a == b for b in colors) for a in set(colors)}



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: