Statementâ–¼
Given two binary strings str1
and str2
, return their sum as a binary string.
Constraints:
1 ≤ str1.length
,str2.length
≤ 500 str1
andstr2
consist of0
or1
characters only.Any string must not contain leading zeros except the string representing the binary form of
0 .