GetRemovedSymbol.cs

CSharp · Console

/Program.cs

using System;
					
public class Program
{
	public static char GetRemovedSymbol(char[] first, char[] second)
	{
		char removedSymbol = '\0';
		for (int i = 0; i < first.Length; i++)
		{
			removedSymbol ^= first[i];
		}
		for (int i = 0; i < second.Length; i++)
		{
			removedSymbol ^= second[i];
		}
		return removedSymbol;
	}
	
	public static void Main()
	{
		Console.WriteLine("UniLecs");
		char[] first = new char[] { 'a', 'b', 'c' };
		char[] second = new char[] { 'a', 'b' };
		Console.WriteLine(string.Format("Answer = {0}", GetRemovedSymbol(first, second))); // 'c'		
	}
}
;