Description: Given an array of integers, remove all duplicate numbers keeping only the last occurrence of each integer. Output the number of remaining elements and the resulting sequence.