News

Given an integer array, we have to print all the distinct element of the input array. input array may contain duplicate elements, we have to print the count of elements that are distinct. Program to ...
Run a loop to iterate over array Set mp[arr[i]]++ After, complete iteration, run a loop over map Check if value == 1, then print the key. Time and Space Complexity : Time Complexity : O(n) Space ...