Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace SoloLearn
- {
- class Program
- {
- public static int find_it(int[] seq)
- {
- int count = 0;
- for (int k = 0; k < seq.Length; k++)
- {
- for (int i = k; i < seq.Length - 1; i++)
- {
- if (seq[k] == seq[i])
- {
- count++;
- }
- }
- }
- if (count % 2 == 0)
- return count;
- }
- static void Main(string[] args)
- {
- int[] oddArr = { 20, 1, -1, 2, -2, 3, 3, 5, 5, 1, 2, 4, 20, 4, -1, -2, 5 };
- Console.WriteLine(find_it(oddArr));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement