title: Remove duplicate strings in string vector
body: <p>I have the code, listed below, which I am trying to get to remove any duplicate football team names from a string vector. However, it is only working sometimes, it will remove duplicate names for some of the teams; but then for others there will be multiple occurrences of the same team name in the final array.</p>
  
  <p>For example it would print:</p>
  
  <pre><code>aresnal
  wigan
  villa
  liverpool
  villa
  </code></pre>
  
  <p>Notice there are two 'villa' names, could anyone give me a suggestion?
  The 'finalLeague' is the array which is storing all of the names, and is the array which needs the duplicates removing out of.</p>
  
  <pre><code>  for (int i = 0;i &lt; finalLeague.size();i++)
    {       
        string temp = finalLeague[i];
        int h = i + 1;
        for (int j = i+1;j &lt; finalLeague.size();j++)
        {
            if (finalLeague[j] == finalLeague[i])
            {               
                finalLeague.erase(finalLeague.begin()+j);     
            }     
        }
    }
  </code></pre>