title: Get previous n elements from list
body: <p>Given a collection, I want to iterate over each element and retrieve the previous N elements. </p>
  
  <p>The data set is very small (hundred elements at most). Readability is primary concern.</p>
  
  <p>Pseudo code...</p>
  
  <pre><code>var values = new List&lt;decimal&gt;
  {
    1m,
    1.5m,
    2m,
    2.5m,
    3.0m,
    3.5m,
    4m,
    4.5m,
    5m
  };
  
  var previousElementsCount = 3;
  
  for (var currentIndex = 0; currentIndex &lt; values.Count - 1; currentIndex++)
  {
  
    var range = values.GetPreviousElements(currentIndex, previousElementsCount);
  
    //currentIndex:0, result: []
    //currentIndex:1: result: [1]
    //currentIndex:2: result: [1.5, 1]
    //currentIndex:3: result: [2, 1.5, 1]
    //currentIndex:4: result: [2.5, 2, 1.5]
    //currentIndex:5: result: [3, 2.5, 2]
    // etc...
  }
  
  public static class ListExtensions 
  {
    public static List&lt;T&gt; GetPreviousElements&lt;T&gt;(this List&lt;T&gt; list, int index, int previousElementsCount)
    {
      // ?
    }
  }
  </code></pre>
  
  <p>How could you implement <code>GetPreviousElements</code>?</p>
  
  <p>Thanks!</p>