← Number of 1 Bits
Discussions
Sign in to join the discussion.
S
sairao5
1 month, 2 weeks ago
Asked in my NVIDIA OA last week.
XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
💬 1 reply
K
kavyasub5
2 months, 3 weeks ago
Finally got AC after 3 WAs. Sharing what I missed.
XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
💬 3 replies
I
imran.n
3 months, 3 weeks ago
Intuition + complexity breakdown for Number of 1 Bits.
XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
💬 1 reply
A
aarav.m
5 months, 2 weeks ago
Finally got AC after 3 WAs. Sharing what I missed.
XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
💬 1 reply