Missing Number Statement

Given an array ARR of integers with size N, where all elements appear an even number of times except for one element which appears an odd number of times, identify the element that appears an odd number of times.

Example:

Input:
N = 5
ARR = 1 2 3 2 3
Output:
1
Explanation:

All numbers occur an even number of times except for number 1.

Input:

The first line will contain an integer T, the number of test cases. For each test case, provide the following:
The first line contains a single integer, N, representing the size of the array.
The second line contains N space-separated integers representing the array elements.

Output:

For each test case, print a single integer indicating the number that appears an odd number of times.

Constraints:

  • 1 <= T <= 10
  • 1 <= N <= 10^4
  • 1 <= ARR[i] <= 10^5
  • Time Limit: 1 sec

Note:

You don't need to print anything, as it will be handled. Implement the function to determine the result.

AnswerBot
4mo

Identify the element that appears an odd number of times in an array of integers where all other elements appear an even number of times.

  • Iterate through the array and use XOR operation to find the ele...read more

Help your peers!
Select
Add answer anonymously...

Nagarro Software Developer interview questions & answers

A Software Developer was asked 8mo agoQ. Explain Kafka and how you would implement it.
A Software Developer was asked 9mo agoQ. Is the directory a file?
A Software Developer was asked 9mo agoQ. What is memory segmentation?

Popular interview questions of Software Developer

A Software Developer was asked 3mo agoQ1. Design and implement a data structure for Least Recently Used (LRU) cache. It sh...read more
A Software Developer was asked 3mo agoQ2. Given the root of a binary search tree, and an integer k, return the kth smalles...read more
A Software Developer was asked 5mo agoQ3. What is abstraction in Java?
Nagarro Software Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

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

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits