https://online.codingblocks.com/app/player/47258/content/26275/6269
I am not able to understand how the Sample Output came from the Sample Input. Could someone explain that and explain another output for a different input
https://online.codingblocks.com/app/player/47258/content/26275/6269
I am not able to understand how the Sample Output came from the Sample Input. Could someone explain that and explain another output for a different input
We are given One test case
In the test case we have 2 pairs
1,2 (one pair)
3,4 (one pair)
Ans = 2
There are two ways to select the shoes(Some is odd).
The two ways are {1,4} and {2,3}.
Explanation is not clear. Please elaborate
There are some pairs given to you. Pairs may/may not contain same element.(Don’t get confused because of “shoes”)
You have to select one element from each pair.
Sum of all elements you pick should be odd.
For given test case,these are possible:
1+3 (even,invalid)
1+4 (odd,valid)
2+3 (odd,valid)
2+4 (even,invalid)
Hence answer is 2.