You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Given an unsorted array of integers, Print the array after removing the duplicate elements from it. We need to print distinct array elements according to their first occurrence.
# Examples:
#
# Input : arr[] = { 1, 2, 5, 1, 7, 2, 4, 2}
# Output : 1 2 5 7 4
# Explanation : {1, 2} appear more than one time.
# Approach :
# Take a hash map, in which will store all the elements which has appeared before.
# Traverse the array.
# Check if the element is present in the hash map.