Post History
Python 3, 50 bytes We can simply omit the lambda name since we don't refer to it anywhere in the lambda definition. lambda l:[l[:i+1].count(j)for i,j in enumerate(l)] Example usage in the term...
#1: Initial revision
# Python 3, 50 bytes We can simply omit the lambda name since we don't refer to it anywhere in the lambda definition. ```python lambda l:[l[:i+1].count(j)for i,j in enumerate(l)] ``` Example usage in the terminal: ```python >>>(lambda l:[l[:i+1].count(j)for i,j in enumerate(l)])([1,1,2,2,2,1,1,1,3,3]) [1, 2, 1, 2, 3, 3, 4, 5, 1, 2] >>>(lambda l:[l[:i+1].count(j)for i,j in enumerate(l)])([3,7,5,4,9,2,3,2,6,6]) [1, 1, 1, 1, 1, 1, 2, 2, 1, 2] ``` I tested this on version 3.8.5 but this should work on earlier as well as newer versions of Python 3.