Find two unique elements

Given an array in which all numbers except two are repeated once. (i.e. we have 2n+2 numbers and n numbers are occurring twice and remaining two have occurred once). Find those two numbers in the most efficient way.

Comments

  1. if we know the range ,it can be solved with the help of hashing inn O(n).

    ReplyDelete
  2. @kamakshi range is not known...

    ReplyDelete

Post a Comment

Popular posts from this blog