Distinct reads n, then n whole numbers, and prints how many different values there are, the different values in the order of their first appearance, and how many repeated values were skipped.
Store the distinct values in an array of size n together with a counter size of the places in use. Write a method indexOf(int[] list, int size, int value) that searches the first size elements. For the input
10
1 2 3 2 1 6 3 4 5 2
the program prints
Numbers read: 10
Distinct numbers: 6
In order of first appearance: 1 2 3 6 4 5
Repeated values skipped: 4