K
kmalhotra
12 Aug 2026, 18:28
Intuition + complexity breakdown for Add Binary Strings.
XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
Intuition + complexity breakdown for Add Binary Strings.
XOR cancels equal numbers, and x & (x - 1) clears the lowest set bit. Both give O(1) space solutions here.
You can avoid the extra array and do it in O(1) space.
For the TLE: you are rebuilding the list inside the loop, move it outside.
Sign in to reply.