Is this solu correct?

and can you provide me problem link

@codingblockscpp hey solution is looking fine but this is ICPC problem to apkocodechef pr icpc archives me hi milega waha ap submit kr skte ho ,to please look their and submit it ,so it will be more confirm to you.Happy coding :slight_smile:

how to return refernce of map

to avoid unnecceasarry copy

@codingblockscpp hey,just use reference variable for map just like this:
int fun(map <int,int> & m)
{
}
and while calling just pass map ,it will make changes in original map and no new copy is created.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.