#K4216. Add Binary Numbers
Add Binary Numbers
Add Binary Numbers
You are given two non-negative binary numbers represented as strings. Your task is to perform binary addition on these two numbers and return the resulting binary string. The addition must be simulated the elementary way by processing each digit (bit) and properly handling the carry.
Note that the binary strings can be very large (up to 104 digits), so converting them directly to numerical types may not be feasible. Instead, you should process the strings character by character.
inputFormat
The input is read from standard input (stdin) and consists of two lines:
- The first line contains the binary string
a
. - The second line contains the binary string
b
.
outputFormat
Output a single line to standard output (stdout) containing the binary sum of the two input strings.
## sample11
1
100