Print the last occurrence of elements in array in relative order
Given an array of N elements, print the elements in the same relative order as given by removing all the occurrences of elements except the last occurrence. Examples: Input: a[] = {1, 5, 5, 1, 6, 1} Output: 5 6 1 Remove two integers 1, which are in the positions 1 and 4. Also, remove the integer 5,