title: Finding the key with most values in map<string, vector<string>>
body: <pre><code>set&lt;string&gt; myFunc (const map&lt;string, vector&lt;string&gt;&gt;&amp; m)
  </code></pre>
  <p>I want to return all the keys in a set of strings, that map the most values (several keys if number of mapped values is the same). My attempt was:</p>
  <pre><code>set&lt;string&gt; ret;
  auto max_e = *max_element(m.begin(), m.end(), [] (const pair&lt;string, vector&lt;string&gt;&gt;&amp; m1, const pair&lt;string, vector&lt;string&gt;&gt;&amp; m2) {
      return m1.second.size() &lt; m2.second.size();
    });
  ret.insert(max_e.first);
  return ret;
  </code></pre>
  <p>Logically, this cannot work (I think) since this would only return one key with the highest value. Any ideas?</p>