I am not able to present he output

https://ide.codingblocks.com/s/233177… i tried every way to make it work with sets and with array but I am not getting the exact output

Don’t do this way. Take input in two different vector arrays, sort them, then do the operations on the second array. Just put the value of minimum frequencies of each element in the array.

sir I am not getting it … can you plz help me with a code

It would be better if you would try to solve it yourself. You’ll learn better.