663

Idea:

Find the total number of matching and then check for every match(left,right) pair whether it is unique or not. To check this find total number of matching using the same algorithm just excluding a pair each time and compare the total number of founded match with the initial one. If it is not reduced than remove that pair.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *