← Discussions on Add Binary Strings
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.

2 replies

aryan.n 2 months ago

You can avoid the extra array and do it in O(1) space.

gurpreet_92 1 month, 4 weeks ago

For the TLE: you are rebuilding the list inside the loop, move it outside.

Sign in to reply.