title: remove list item based on index c#
body: <p>I have two lists.
  First list contains values such as letters and numbers.
  Length is [0]-[36].
  Second list contains similar values and length is also [0]-[36].</p>
  
  <p>I iterate second list twice with specific values to grab an Index key and when I grab Index key from second list, I want to remove items in first list based on Indexes from second one.</p>
  
  <p>Problem is that second iteration doesn't work anymore, because index key has changed in first list.</p>
  
  <p>I should probably convert list to an array (array has fixed index keys, list generates after) but I don't know how to add or remove index key from an array.</p>
  
  <p>I don't use Linq.</p>
  
  <p>Appreciate your help and suggestions
  BR</p>
  
  <p>Code sample:</p>
  
  <pre><code>List&lt;int&gt; list_z = new List&lt;int&gt;();
  List&lt;int&gt; list_k = new List&lt;int&gt;();
  
  for (int i = 0; i &lt; second_list.Count; i++) {
      if (second_list[i] == "K")
      {
      list_k.Add(i);
      }
  }
  
  int k = list_k.Count; 
  
  for (int i = 0; i &lt; k; i++) {
      first_list.RemoveAt(list_k[i]);
  }
  
  for (int i = 0; i &lt; second_list.Count; i++)
  {
      if (second_list[i] == "Z")
      {
      list_z.Add(i);
      }
  }
  
  int z = list_z.Count;
  for (int i = 0; i &lt; svi_z; i++)
      first_list.RemoveAt(lista_z[i]); //here is error, because first_list doesnt have index key number 36 anymore
  }
  </code></pre>