C# Adjacent Elements Product
static long AdjacentElementsProduct(int[] inputArray)
{
long max = long.MinValue;
for (int i = 0; i < inputArray.Length - 1; i++)
{
max = Math.Max(max, (long)inputArray[i] * inputArray[i + 1]);
}
return max;
}
This walks through neighboring values, multiplies each pair, and keeps the biggest product it finds.