Function to return the updated frequency map for the array passed as argument
map < int , int > getFrequencyMap ( int arr [ ] , int n ) { map < int , int > hashMap ; for ( int i = 0 ; i < n ; i ++ ) { hashMap [ arr [ i ] ] ++ ; } return hashMap ; }