I am not able to do this question. I know that this question is to be done using hashmaps by storing the frequencies of each element in the array. After this I am not able to do it.
I even referred to Geeks for Geeks but I am not able to understand there. Please help !!