using System;
public class Program
{
public static void Main()
int[] array = new int[] {2, 3, 4, 5};
int candidate = array[0], count = 1, i = 1;
while(i < array.Length) {
if(candidate == array[i])
count++;
else {
count--;
if(count == 0) {
candidate = array[i];
}
Console.WriteLine("Result: " + candidate);