title: How to group the Similar value array in c#
body: <pre><code>class Program
  {
      static void Main(string[] args)
      {
  
          int[] arr1 = { 1, 2, 3, 4 };
          int[] arr2 = { 1, 2, 3 };
          int[] arr3 = { 1, 2, 3 };
          int[] arr4 = { 1, 2, 3, 4 };
          int[] arr5 = { 1, 2, 3, 4 };
          int[] arr6 = { 1, 2, 3, 4, 5 };
  
          Order Order1 = new Order { OrderId = 1, Deatils = arr1 };
          Order Order2 = new Order { OrderId = 2, Deatils = arr2 };
          Order Order3 = new Order { OrderId = 3, Deatils = arr3 };
          Order Order4 = new Order { OrderId = 4, Deatils = arr4 };
          Order Order5 = new Order { OrderId = 5, Deatils = arr5 };
          Order Order6 = new Order { OrderId = 6, Deatils = arr6 };
  
          // I want to Output like this based on same values in details object.
          string similarOrderDetailsOrderIds_1 = &quot;1,4,5&quot;;
          string similarOrderDetailsOrderIds_2 = &quot;2,3&quot;;
          string similarOrderDetailsOrderIds_3 = &quot;5&quot;;
  
      }
  }
  
  public class Order
  {
      public int OrderId { get; set; }
      public int[] Deatils { get; set; }
  
  }
  </code></pre>
  <p>I want to output like this because OrderId-1,4,5 have the same values in Details.</p>
  <p>string similarOrderDetailsOrderIds_1 = &quot;1,4,5&quot;;</p>
  <p>string similarOrderDetailsOrderIds_2 = &quot;2,3&quot;;</p>
  <p>string similarOrderDetailsOrderIds_3 = &quot;5&quot;;</p>