all numbers of an array occur seven times only one occur 6 times find that element
Answers
Answered by
0
Hey mate
Ur ans is
Given an array that contains odd number of occurrences for all numbers except for a few elements which are present even number of times. Find the elements which have even occurrences in the array in O(n) time complexity and O(1) extra space.
Assume array contain elements in the range 0 to 63.
Examples :
Input: [9, 12, 23, 10, 12, 12, 15, 23, 14, 12, 15]
Output: 12, 23 and 15
Input: [1, 4, 7, 5, 9, 7, 3, 4, 6, 8, 3, 0, 3]
Output: 4 and 7
Input: [4, 4, 10, 10, 4, 4, 4, 4, 10, 10]
Output: 4 and 10
Similar questions
Social Sciences,
7 months ago
Environmental Sciences,
7 months ago
Chemistry,
1 year ago
Social Sciences,
1 year ago
English,
1 year ago