Post History
Python 3, 70 bytes def f(a): d={};r=[] for x in a:d[x]=d.get(x,0)+1;r+=[d[x]] return r Try it online!
Answer
#1: Initial revision
# [Python 3](https://www.python.org/), 70 bytes ```python def f(a): d={};r=[] for x in a:d[x]=d.get(x,0)+1;r+=[d[x]] return r ``` [Try it online!](https://tio.run/##dY9Ba8MwDIXv@RWip5iKsSRdx1J8KGyDwQ6DHk0YWa0sgeIE2xkZIb89s53SQceki/Wk9/Hcfdu6Vdk8S6qgikuWRyD5OO00F0UEVathgEZBmUsxFFzefJKNB7xl62Sn11x41d1psr1WoGdLxh5LQwY4iAhcxSLBBNPQSegMswJBJEFI/YgbvPPvguHZk@G9kzb4EA5S3OJ28fz2AgyeIop80kZ1vUWgoaOjJfne9tYJPv4lVh745wV3Pw4eFtSmuiz4NWTx@ep0o2xcrd72h8PTY@4QY2BMzPHG5XpaLUQ6GfrrfN6/vP7rRDB1258k1OUXwQeRgvEqi6PPPw "Python 3 – Try It Online")