All submissions for this problem are available.PROBLEM STATEMENT
In Banasthali, we feel like a family. Every festival is celebrated with great zeal and enthusiasm; so is Dushhehra. Every year, the Banasthalites get really excited about watching the firework show on Dushhehra.
This year, Shreyasi has taken up the responsibility and is given a box of crackers. She has been told that the box contains 'n' types of crackers, where each type of cracker occurs exactly twice except for one 'Special Cracker'.
Each type of cracker is associated with some number which can be considered as elements of an array. Note that, there is no case where there wont be a 'Special Cracker'.
Given a box of crackers, help Shreyasi find the 'Special Cracker'.
The first line contains a single integer 't' representing the number of test cases.
The next 2*'t' lines contain a single integer 'n' denoting the number of crackers in the box, followed by 'n' space-separated integers a[i] indicating the numbers associated with the crackers in the box.
Print the 'Special Cracker' that occurs only once in the box.
1 <= t <= 100
1 <= n <= 10^5
2 2 3
In the given case, there are three crackers. The first two are of the type-2 and the third is of type-3. This is the special cracker- the only cracker with type-3. Therefore, 3 is the answer.
|Tags||bit, bitf2016, easy, kaushambi, manipulation, xor|
|Time Limit:||0.5 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions