Dec 15, 2024
I was considering showing the example with `map` but I assumed it might be more confusing for early coders. As for sorting the array - you won't get the counts for each value but you would get the highest and lowest counts. That's not a bad solution but in the worst case, it would be less performant than simply iterating and tracking highest/lowest.