top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How could find Number that Appears Only once in array of Duplicates?

+3 votes
377 views
How could find Number that Appears Only once in array of Duplicates?
posted Dec 9, 2014 by Vrije Mani Upadhyay

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

There are 3-4 ways of solving this question.
1) Solve it in O(n^2). --- :).
2) Use hash table.
3) Do XOR of all the numbers. The final result is the the number that appears once.

answer Dec 20, 2014 by Prakash
Similar Questions
+6 votes

For example: It returns ‘b’ when the input is “abaccdeff”.

+1 vote

Given an array of 1s and 0s which has all 1s first followed by all 0s. Find the number of 0s. Count the number of zeroes in the given array.

0 votes

Given a string S and set of strings U. Find the length of longest prefix of S that can be formed using strings in U.

For example you have following -

S= “absolute”
U={“abs”,”xyz”,”ol”,”te”}

Answer: 5 i.e "absol"

Now the task is to have the algorithm/program for the above problem, please help me with this?

...