void count(int arr[] , int n){ map<int ,int>d; for(int i=0;i<n ;i++){ d[arr[i]]++; } for(auto i : d){ cout<<d.first<<" "<<d.second<<"\n"; } }
i.first
d.first
<pre>for(auto i : d){ cout<<i.first<<" "<<i.second<<"\n"; }
Quote:I think the map has first and second member inbuilt in it
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)