← Reverse Bits
Discussions
Sign in to join the discussion.
A
aditimenon
OFFICIAL
2 months, 3 weeks 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
6 months 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