Programming Exercises > Number Appearing Once in Array where All Other Numbers Appear Three Times Problem Statement An array of integers is given, such that each number appears exactly three times in it with exception of one number which appears only once. Write a function returning number which appears once in the array. Example: Suppose that array consists of numbers 2, 4, 5, 1, 1, 4, 1, 2, 3, 5, 5, 4, 2. The function should return value 3, because that is the number which appears only once. All other numbers appear three times.
Read full article from Finding a Number which Appears Once in Array where All Other Numbers Appear Three Times
No comments:
Post a Comment