title: how to get the third element (from the beginning and from the end) in a map c++
body: <p>I want to access the third element(both in forward and reverse order) without iterating the map.</p>
  
  <pre><code>int main() {
  map&lt;int,int&gt;mp;
  vector&lt;int&gt;v={1,4,2,5,4,2,5,7,6,9,7,9,8};
  for(int i=0;i&lt;v.size();++i)
  {
      mp[v[i]]++;
  }
  return 0;
  </code></pre>
  
  <p>}</p>
  
  <p>here the expected output would be 4 2 and 7 2.</p>