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.
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.