Author: Ranjan Kumar Singh
Tester: Sudipto Roy
Editorialist: Ved Prakash
There are 15 numbers to sort according to number of 1’s in its binary operation. Then perform the XOR operation and find the number of 1’s in it. Finally compare the number of 1’s in the resulted number and X.
If number of 1’s is greater than X print YES else print NO.
For the XOR operation, order of the numbers doesnot matter. Hence simply it is needed to xor the numbers. Then count the number of ones in the number obtained by XORing. Compare the number of 1’s with X and print YES
or NO accordingly.
num=0 for i=1 to 15: num^ = arr[i] while(num) if(num%2) ones++ num/=2