134. Add Binary
Easy · String
Write a function that adds two binary numbers together. You will receive two binary strings (containing only '0' and '1' characters) as input. Return their sum as a binary string, with no leading zeros (except for the result '0' itself). For example, the binary number '11' is 3 in decimal, and '1' is 1 in decimal, so their sum is 4, which is '100' in binary.
Examples
Example 1 Input: ["11", "1"] Output: "100" Explanation: 3 + 1 = 4 = 100₂
Example 2 Input: ["1010", "1011"] Output: "10101" Explanation: 10 + 11 = 21 = 10101₂
Constraints
- Standard input/output constraints apply