using System;
using System.Collections.Generic;
class Program
{
static void Main()
{
List<int> numbers = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
// Define the start index and count of elements to remove
int startIndex = 2; // Starting at index 2 (third element)
int endIndex = 5; // Ending at index 5 (sixth element)
// Calculate the count of elements to remove
int count = endIndex - startIndex + 1;
// Remove the range
numbers.RemoveRange(startIndex, count);
// Print the updated list
Console.WriteLine(string.Join(", ", numbers));
}
}
/*
run:
1, 2, 7, 8, 9
*/