title: Linq: Edit GroupID of Students based on Common Interests
body: <p>I have a list of students with their subject of interests (separated by comma).</p>
  <pre><code>List&lt;Students&gt; students = new List&lt;Students&gt;(); 
                             
  students.Add(new Students() { Name = &quot;Krishna&quot;, GroupID= 0, Interests = &quot;Physics,Maths&quot; });
  
  students.Add(new Students() { Name = &quot;Ganesh&quot;, GroupID= 0, Interests = &quot;History,Physics&quot; });
  
  students.Add(new Students() { Name = &quot;Jayesh&quot;, GroupID= 0, Interests = &quot;Tech,Humanity&quot; });
  
  students.Add(new Students() { Name = &quot;Aditya&quot;, GroupID= 0, Interests = &quot;Science&quot;});
  
  students.Add(new Students() { Name = &quot;Ramesh&quot;, GroupID= 0, Interests = &quot;Programming,Science&quot;});
  </code></pre>
  <p>I want to use the <code>Linq</code> to edit the <code>GroupID</code> of students in the same list based on their common interests.</p>
  <p><strong>Expected Output:</strong></p>
  <p>GroupID 1;
  Students: Krishna, Ganesh
  (Reason: Common interest in Physics)</p>
  <p>GroupID 2;
  Students: Aditya, Ramesh
  (Reason: Common interest in Science)</p>
  <p>Any help is greatly appreciated.</p>
  <p>Thank you so much!</p>