I have an array and it looks like this: [7, 2, 3, 2, 2, 1]. As you can see there are three elements in this array with the integer value of 2. I want to take this array and create an index that will look something like this: { 1 => 1, 2 => 3, 3 => 1, 4 => 0, 5 => 0, 6 => 0, 7 => 1 }
So, basically a bar chart/histogram/index of a how many duplicates there are in the array.
Just for a high level view of this. I'm trying to find all of the unique emails for each account within my application.