you give 0indexe positive integer array num positive integer kA pair number num1 num2 call excellent follow condition satisfiedboth number num1 num2 exist array numsthe sum number set bit num1 or num2 num1 and num2 greater equal k or bitwise or operation and bitwise and operationreturn number distinct excellent pairsTwo pair b c d consider distinct c b d for example 1 2 2 1 distinctnote pair num1 num2 num1 num2 excellent occurrence num1 array Example 1input num 1231 k 3output 5explanation the excellent pair follow 3 3 3 and 3 3 or 3 equal 11 binary the total number set bit 2 2 4 great equal k 3 2 3 3 2 2 and 3 equal 10 binary 2 or 3 equal 11 binary the total number set bit 1 2 3 1 3 3 1 1 and 3 equal 01 binary 1 or 3 equal 11 binary the total number set bit 1 2 3so number excellent pair 5example 2input num 511 k 10output 0explanation there excellent pair array Constraints1 numslength 1051 numsi 1091 k 60