title: How to convert a string of HashSet to a 2D vector in c++ ? This is a 3-sum problem in leetcode
body: <pre><code>
  // nums = [-1,0,1,2,-1,-4]
  // result should be = {{-1,-1,2},{-1,0,1}}
  
  vector&lt;vector&lt;int&gt;&gt; threeSum(vector&lt;int&gt;&amp; nums) {
          sort(nums.begin(),nums.end());
          unordered_set&lt;string&gt; s;
          for(int start1=0; start1&lt;nums.size(); start1++){
              for(int start2=start1+1; start2&lt;nums.size(); start2++){
                  for(int start3=start2+1; start3&lt;nums.size(); start3++){
                      string str = &quot;&quot;;
                      if(nums[start1]+nums[start2]+nums[start3] == 0){
                          str +=  to_string(nums[start1])+
                                  to_string(nums[start2])+
                                  to_string(nums[start3]);
                      }
                      s.insert(str); //s{&quot;-1-12&quot;,&quot;-101&quot;}
                  }
           }
   }
  </code></pre>
  <p><strong>After inserting values to set s, s look as follows</strong>
  <code>s{&quot;-1-12&quot;,&quot;-101&quot;}</code>
  The problem is how I can convert that set to a 2d vector in c++.
  <em>I wanted to return a 2D vector of integers.</em></p>