I have N playing cards on which numbers are written on front as well as back.Now In one move I can flip any card so that its bottom now becomes the top.
Given the numbers on top and bottom of cards I need to find minimum number of moves that can make at least half of the cards show same number on their top.
If it is not possible to do so then also tell that it is not possible.
Example : Say we have 3 cards and represented as (number on top,number on bottom)
Card 1 : (3,10)
Card 2 : (10,3)
Card 3 : (5,4)
Now ,here minmum moves is just 1 as we can flip the first card so that number on the top becomes 10. Since two of the three cards have same number on their top (10), we do not need to change anything else, so the answer is 1.