def addBinary(a: str, b: str) -> str:
    # Initialize pointers for both strings
    i = len(a) - 1
    j = len(b) - 1
    
    # Variable to store the carry
    carry = 0
    
    # Result list to store the sum of binary digits
    result = []
    
    # Iterate over both strings from right to left
    while i >= 0 or j >= 0 or carry:
        # Get the current bit from each string or 0 if pointer is out of bounds
        bit_a = int(a[i]) if i >= 0 else 0
        bit_b = int(b[j]) if j >= 0 else 0
        
        # Calculate the sum of bits and carry
        total = bit_a + bit_b + carry
        
        # Append the current bit to the result
        result.append(str(total % 2))
        
        # Update the carry
        carry = total // 2
        
        # Move to the next bit
        i -= 1
        j -= 1
    
    # Since we have constructed the result backwards, reverse it before returning
    return ''.join(result[::-1])

# Example usage:
print(addBinary("11", "1"))       # Output: "100"
print(addBinary("1010", "1011"))  # Output: "10101"