title: Grouping Contiguous Dates
body: <p>I have a <code>List&lt;DateTime&gt; dates;</code></p>
  
  <p>I have a class that has:</p>
  
  <pre><code>class NonWorkingDay
  {
     public DateTime Start;
     public int Days;
  }
  </code></pre>
  
  <p>I am trying to figure out a clean way to group them.</p>
  
  <pre><code>public List&lt;NonWorkingDay&gt; GetContiguousDates(List&lt;DateTime&gt; dates)
  {
  
  }
  </code></pre>
  
  <p>Note: if there is an NWD on Friday and the next is Monday they should be grouped. Weekends are not considered.</p>
  
  <p>For example if I have</p>
  
  <pre><code>September 3 2013
  September 20 2013
  September 23 2013
  September 24 2013
  September 30 2013
  October 1  2013
  </code></pre>
  
  <p>The output would be:</p>
  
  <pre><code>Start = September 3 2013, Days = 1
  Start = September 20 2013, Days = 3 //weekend got skipped
  Start = September 30 2013, Days = 2
  </code></pre>
  
  <p>Is there any way to do this (without have a bunch of counter variables) and using .Select or .Where or something.</p>
  
  <p>Thanks</p>