We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Yes in all cases but 4 and 5, which is a case where A and B have the same number of elements and the same number of each value. In this case changing B results in one less pair.
ORIGINAL
A : 1 1 1
B : 1 1 1
CHANGE
A : 1 1 1
B : 1 1 2
In a case like this without changing B, you can get 3 pairs,but since you have to change B, you only get 2.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Pairs
You are viewing a single comment's thread. Return to all comments →
Yes in all cases but 4 and 5, which is a case where A and B have the same number of elements and the same number of each value. In this case changing B results in one less pair.
In a case like this without changing B, you can get 3 pairs,but since you have to change B, you only get 2.