You have an array A of size N, populated with unique and duplicate integer values, you have
Fantastic news! We've Found the answer you've been seeking!
Question:
You have an array A of size N, populated with unique and duplicate integer values, you have to find how many unique values are there in the array (array is sorted), also you have to find the duplicate value that is there for a minimum number of times. At max one-time access of array, O (N) complexity.
The solution is first in English or pseudo steps, then the exact solution.
(To be done in C++)
Related Book For
Posted Date: