public static void Main()
Console.WriteLine("Previous");
int[, ] shipPosition = new int[3, 2]{{2, 3}, {4, 5}, {6, 7}};
Console.WriteLine("After");
int[, ] result = DeleteRow(1, shipPosition);
public static int[, ] DeleteRow(int rowDeleteIndex, int[, ] sourceArray)
int rows = sourceArray.GetLength(0);
int cols = sourceArray.GetLength(1);
int[, ] result = new int[rows - 1, cols];
for (int i = 0; i < rows; i++)
for (int j = 0; j < cols; j++)
result[i >= rowDeleteIndex ? i - 1 : i, j] = sourceArray[i, j];
public static void DrawArray(int[, ] sourceArray)
int rows = sourceArray.GetLength(0);
int cols = sourceArray.GetLength(1);
for (int i = 0; i < rows; i++)
for (int j = 0; j < cols; j++)
Console.Write(sourceArray[i, j] + " ");