← Reverse Bits
Discussions
Sign in to join the discussion.
A
aditimenon
OFFICIAL
1 month, 1 week ago
Why does my solution TLE on the last test case?
XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
💬 2 replies
K
kavyanai4
4 months, 2 weeks ago
Intuition + complexity breakdown for Reverse Bits.
XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
💬 3 replies