I want to count the number of occurrences of numbers from an array and put it into an array on its index, for example:
[1,2,0,0,0,1,5,4,2,6,1]
would give:
[3,3,2,0,1,1,1]
I tried to do it with map
and push
but the solution sound really archaic.