Similar to Remove Duplicates from Sorted Array. Use another array to count the times one number appears.