Interview Question


Given numbers 1 to 100 in an array a random number was

  replaced with 0. Find the which number it was in constant time (100).

Interview Answer

1 Answer


easy add all elements of array and store in a variable n sum(100)-n is the answer

ABHINAV on Feb 10, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.