Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ssz
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] c_temp = Console.ReadLine().Split(' '); int[] c = Array.ConvertAll(c_temp,Int32.Parse); Array.Sort(c); int count =0; // bool pair = false; ArrayList al = new ArrayList(); for(int i=0; i<n ; i++){ if(!al.Contains(c[i])){ al.Add(c[i]); }else{ count++; al.Remove(c[i]); } } Console.WriteLine(count); } } }
run
|
edit
|
history
|
help
0
golestanali
The Collatz Conjecture
Merging and sorting 2 arrays using LINQ
Reverse a String Using Hash Function
Area and Parameter of Circle
ByVal
((((STReaming))))%^%% The 2022 RBC Canadian Open Golf PGA Tour event
Compression Decompressor
DateTime and TimeSpan comparisons
Fibonacci Series