Reverse array in-place concept; print reversed.
| Test | Status | Details |
|---|
Ready — edit the code above and click Run or Submit.
using System;
class Program
{
static void Main()
{
int[] a = { 1, 2, 3, 4, 5 };
Array.Reverse(a);
Console.WriteLine(string.Join(" ", a));
}
}
Try solving on your own first, then reveal the official answer.
Array.Reverse or two-pointer swap.