4

Possible Duplicate:
Find a special number in an array

Given an array that contains all elements thrice except one. Find the element which occurs once. Time complexity- O(n). Space complexity- O(1).

Eg. ar[10]={1,2,1,2,5,5,5,7,1,2}. ans= 7.

Community
  • 1
  • 1
Manish
  • 1,999
  • 2
  • 15
  • 26

0 Answers0