Missing Number Problem Statement

You are provided with an array named BINARYNUMS consisting of N unique strings. Each string represents an integer in binary, covering every integer from 0 to N except for one. Your task is to identify this missing integer and return its binary representation as a string without any leading zeros.

Input:

The first line indicates an integer T, the number of test cases. Each test case consists of: First line: An integer N indicating the number of binary strings in BINARYNUMS. Second line: N space-separated binary strings representing BINARYNUMS. 

Output:

For each test case, output a single string, representing the binary form of the missing integer without leading zeros. Each test case result should be on a different line. 

Example:

Input: N = 5, BINARYNUMS = ["0", "01", "010", "100", "101"] Output: "11" Explanation: The missing number is 3 and its binary representation is "11". 

Constraints:

  • 1 <= T <= 50
  • 1 <= N <= 10^4
  • Time limit: 1 second.

Note:

Ensure your implementation returns the output without printing to the console, as output handling is already managed. 
AnswerBot
4mo

Identify the missing integer in an array of binary strings and return its binary representation without leading zeros.

  • Iterate through the binary strings to convert them to integers and find the missin...read more

Arvind Kushwaha
1y

Without Convert into integers

The number of bits required to represent an integer ‘N’ will be floor(logN) + 1 (log on base 2).

You can observe that number of integers between 0 to N (inclusive) that ha...read more

Help your peers!
Select
Add answer anonymously...

Capgemini Software Engineer interview questions & answers

A Software Engineer was asked 1w agoQ. How do you communicate between Microservices?
A Software Engineer was asked 1mo agoQ. Given a string, determine if it is a palindrome, considering only alphanumeric c...read more
A Software Engineer was asked 1mo agoQ. What is the difference between local and global variables?

Popular interview questions of Software Engineer

A Software Engineer was asked 1mo agoQ1. Given a string, determine if it is a palindrome, considering only alphanumeric c...read more
A Software Engineer was asked 1mo agoQ2. Briefly describe the C language.
A Software Engineer was asked 1mo agoQ3. What is the difference between local and global variables?

Top HR questions asked in Capgemini Software Engineer

A Software Engineer was asked 7mo agoQ1. What was your role in your previous project?
A Software Engineer was asked 8mo agoQ2. What are you good at?
A Software Engineer was asked 8mo agoQ3. Where do you see yourself in five years?
Capgemini Software Engineer 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