Unique Element In Sorted Array

Nobita wants to impress Shizuka by guessing her lucky number.

Shizuka gave Nobita a sorted list of ‘N’ numbers such that every number occurred twice in the list except Shizuka’s lucky number which appears only once.

Nobita asked Doraemon to help him but Doraemon doesn’t have a gadget that can find Shizuka’s lucky number.

So, Doraemon called you to find Shizuka’s lucky number. The fate of Nobita lies in your hand.

Note :

1. Shizuka’s lucky number will surely be present.
2. There will only be a single lucky number.
Input Format :
The first line of input contains an integer 'T' representing the number of test cases. Then the test cases follow.

The first line of each test case contains a single integer ‘N’, representing the total number of elements present in Shizuka’s list.

The next line contains ‘N’ single-spaced elements, representing the elements of Shizuka’s list
Output Format :
For each test case, print an integer denoting the lucky number of Shizuka.

The output for each test case will be printed in a separate line.    
Constraints :
1 <= T <= 5
1 <= N <= 10^5
0 <= data <= 10^9

Where ‘data’ is the value of elements of Shizuka’s list. 

Time Limit: 1 sec
Note :
You do not need to print anything, it has already been taken care of. Just implement the given function.
Be the first one to answer
Add answer anonymously...
Josh Technology Group Intern Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter