title: Finding most common element in a list (C++ STL)?
body: <p>I have a program where I have to find the most common element in a list of integers. I do this with the program below, but the problem is, I suspect that the erase function messes up with the iterator incrementation in the <code>countRepetition()</code> function. My question is how can I fix the problem or if this is not the issue what is it?</p>
  
  <p>Thanks in advance. </p>