So lets say i have an array of ints (max being its maximum size)
array = { 1, 7, 22, 3, 7, ... }
and i need to find a way to count the duplicates of each element in the previous array into another array like this one
duplicates = { { 1, 2 times }, { 7, 3 times } ...}
i know the syntax is wrong i just wanted to exemplify my goal (hope i expressed myself well enough) .. i have been thinking and i cant think of a way to do this (maybe it's simple but im kinda new at this) so i decided to post here for some guidance.
Thanks in advance
CnotC++? It would much easier to write this inC++..