Interview Question

Junior Software Developer Interview

-Toronto, ON

FDM Group

If I have an array of size N that contains the numbers between 1-50, what's the most efficient way to find a duplicate?

Answer

Interview Answers

2 Answers

1

Trick is to disregard the size N and focus on the range of 1-50, solution should be O(1).

Anonymous on

0

Binary search it

Amandeep on

Add Answers or Comments

To comment on this, Sign In or Sign Up.