public static bool PosOrder(int[] arr)
for (int i = 1; i < arr.Length; i++)
public static int Winner(int[] votes, int num)
int[] count = new int[num + 1];
for (int i = 0; i < count.Length; i++)
for (int i = 0; i < votes.Length; i++)
for (int i = 2; i < count.Length; i++)
if (count[i] > count[winner])
public static void Main()
int[] arr = {5, 9, -3, 17, 0, 29, -20, -40, 29};
Console.WriteLine(PosOrder(arr));
int[] votes = {3, 2, 1, 3, 4, 3, 3, 1, 1, 1};
Console.WriteLine(Winner(votes, 4));