C++ How do i find most repeated elements in a vector

I am trying to find most repeated elements in a vector.

Lets say this is the vector:
[2,3,4,6,3,2,9 17,2,21,3,6,9,12]

in this case 2 is repeated 3 times and 3 is repeated 3 times

how to output this ???
std::map<int,int>
Topic archived. No new replies allowed.