0

Possible Duplicate:
Finding a single number in a list

I have an array of size 10^5 now ,There will be odd number of element in array, and each number has a pair except one element. Find that unique element

I have applied sorting then comparing 1 and 2 , 3 and 4 , so when when they are not equal i will get my odd one out.

but i am being given 1-2 sec for this , so it gives "Time limit Exceeded", so can you tell me any other way to decrease the time .

Community
  • 1
  • 1
Sudhanshu Gupta
  • 2,255
  • 3
  • 36
  • 74
  • Is this some kind of programming challenge or educational/homework assignment? – reuben Feb 21 '12 at 05:30
  • Have you considered alternative ideas to your approach? Do you need to sort the array to compute the answer? – reuben Feb 21 '12 at 05:33

0 Answers0