class Check
{
public static void Main()
{
int[] arr1 = new int[] { 1, 2, 3 };
Console.WriteLine(\"The Number That Left Us
Arrays cannot be resized, if you want to remove items use a List
.
However, you can create a new one. If you want to keep all items but one at the random index:
arr1 = arr1.Where((i, index) => index != r).ToArray();
With a list you can use RemoveAt which is more efficient than creating arrays:
var list = new List { 1, 2, 3 };
list.RemoveAt(r);