← Number of 1 Bits
Discussions
Sign in to join the discussion.
S
sairao5
3 days, 6 hours 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
1 month 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
2 months, 1 week 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
4 months 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