Write a function named "eliminate_duplicates" that takes an array of integers in random order and eliminates all the duplicate integers in the array. The function should take two arguments: (1) an array of integers; (2) an integer that tells the number of cells in the array. The function should return the number of distinct integers in the array.