Question DSA-BIT-0017
HardWhat is the output of this code?
nums = [5, 5, 7, 5]
res = 0
for b in range(32):
if sum((x >> b) & 1 for x in nums) % 3:
res |= 1 << b
print(res)
- A.
15
- B.
3
- C.
7
- D.
1
Sign up free to see the answer and a step-by-step explanation.