title: Find if vector is subvector c++
body: <p>Assume that I have:</p>
  
  <pre><code>std::vector&lt;string&gt; group;
  std::vector&lt;string&gt; subGroup;
  </code></pre>
  
  <p>Some properties about those two vectors: </p>
  
  <p>1) All elements are unique.</p>
  
  <p>2) They're not sorted, and sorting is not an option.</p>
  
  <p>I need to check if group contains subgroup. If it does, than I need to return true, if it doesn't return false. </p>
  
  <p>Examples:</p>
  
  <p>group = {"A","B","C","D"}, subGroup = {"A","D","E"} -> answer = false</p>
  
  <p>group = {"A","E","C","D"}, subGroup = {"A","D","E"} -> answer = true</p>
  
  <p>My current implementation is: </p>
  
  <pre><code>int cont=0;
  if(subGroup.size() &gt; group.size())
      return false;
  else{
      for(int i=0; i&lt;subGroup.size(); i++){
          for(int j=0; j&lt;group.size(); j++){
              if(subGroup[i] == group[j]{
                  cont++;
              }
          }
      }
      if (cont == subGroup.size())
              return true;
      return false;
  }
  </code></pre>
  
  <p>I checked on this post here <a href="https://stackoverflow.com/questions/24388840/locate-sub-vectorstring-in-another-vectorstring">locate sub-vector&lt;string&gt; in another vector&lt;string&gt;</a> , but I'm not supposed to use C++11 features and also this answer does not solve my problem (using my example 2 for instance, it will return false). </p>
  
  <p>Two things: is my implementation ok or is there any mistakes? Is there an easier way to implement it using STL features or anything like it?</p>