**Difficulty: Easy**

**Frequency: N/A**

Given two binary strings, return their sum (also a binary string).

For example,

a = `"11"`

b = `"1"`

Return `"100"`

.

**My solution:**

**Data structure:**

**Steps:**

**Complexity:**

**Test cases:**

**Corner cases:**

**Code:**

class Solution { public: string addBinary(string a, string b) { string result = ""; int i = a.size() - 1, j = b.size() - 1, carry = 0; while (i >= 0 || j >= 0 || carry) { int sum = ((i >= 0 ? (a[i] - '0') : 0) + (j >= 0 ? (b[j] - '0') : 0) + carry) % 2; carry = ((i >= 0 ? (a[i] - '0') : 0) + (j >= 0 ? (b[j] - '0') : 0) + carry) / 2; result = to_string(sum) + result; i--; j--; } return result; } };

**Another solution:**

**Data structure:**

**steps:**

**Complexity**:

**Code**:

**Things to learn:**