Perfect Pair( not able to understand test case)

sir i ihink there is something wrong in question can u please explain the test case as according to me there is only one pair whose and is zero

Yes the sample test case is printed wrong.
Output will be 2 for the sample test case.
34&29 = 0
29&34 = 0