Getting wrong ans

https://www.codechef.com/JULY20B/problems/CHFNSWPS

my solution -https://ide.codingblocks.com/s/389784

please check my code only 1 test case is passing rest are failing please check the fault in my code

Hey @shivamgoel150
Please explain ur logic after removing common elements

sir i removed the common elements from the map because they dont participate in swapping and after that i make a vector A from the map. as the every elements in the map is present even number of time and we have to do swapping half the number of time the element present in array A. so i put the half of occurrance of every element in array A and did the same thing in array B

Hey @shivamgoel150

            ll minimum=(*mp.begin()).first;
            
            // for(auto i:v1) //removed
            // minimum=min(minimum,i);

minimum should be minimum of both the initial vectors

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.