title: How can i remove/filter out lists count 1 from the main list?
body: <pre><code>var groupedCustomerList = pairList
      .GroupBy(u =&gt; u.Distance)
      .Select(grp =&gt; grp.ToList())
      .ToList();
  
          foreach(List&lt;PosDisPair&gt; list in groupedCustomerList)
          {
            if (list.Count() == 1)
              {
                  groupedCustomerList.Remove(list);
              }
          }
  </code></pre>
  
  <p>I'm getting exception on the line:</p>
  
  <pre><code>foreach(List&lt;PosDisPair&gt; list in groupedCustomerList)
  </code></pre>
  
  <p>groupedCustomerList is list with many lists inside and i want to remove all the lists that are count 1.</p>
  
  <p>InvalidOperationException: Collection was modified; enumeration operation may not execute.</p>