Marks :10
: 6 | : 0
Intuit has $$$N$$$ experts where each expert knows exactly one language and one topic (represented by pair $$$x$$$ and $$$y$$$). We have $$$M$$$ customers where each customer has exactly one language and one topic which they want the expert to match with.
If a customer doesn't match with an expert then they are unhappy.
Find total number of unhappy customers after assigning.
First line of the input contains two integers, $$$N$$$ (1 $$$\leq$$$ $$$N$$$ $$$\leq$$$ $$$1e5$$$) and $$$M$$$ (1 $$$\leq$$$ $$$M$$$ $$$\leq$$$ $$$1e5$$$)
Next N lines contain the language and topic known by each expert, represented by two integers $$$x$$$ (1 $$$\leq$$$ $$$x$$$ $$$\leq$$$ $$$1e5$$$) and $$$y$$$ (1 $$$\leq$$$ $$$y$$$ $$$\leq$$$ $$$1e5$$$)
Next N lines contain the language and topic customer wants to learn, represented by two integers $$$x$$$ (1 $$$\leq$$$ $$$x$$$ $$$\leq$$$ $$$1e5$$$) and $$$y$$$ (1 $$$\leq$$$ $$$y$$$ $$$\leq$$$ $$$1e5$$$) .
Output a single integer, the number of unhappy customers.
3 2 1 2 2 1 1 1 1 2 4 4
1
3 2 1 2 2 1 1 1 1 2 1 1
0
1 2 1 2 1 2 1 1
1
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.