0 out of 464 challenges solved

Index-wise Addition of Nested Tuples

Write a Python function `add_nested_tuples` that takes two nested tuples of the same structure and performs index-wise addition of their elements. The function should return a new nested tuple containing the results of the additions.

#### Example Usage
```python [main.nopy]
result = add_nested_tuples(((1, 3), (4, 5)), ((6, 7), (3, 9)))
print(result)  # Output: ((7, 10), (7, 14))

result = add_nested_tuples(((2, 4), (5, 6)), ((7, 8), (4, 10)))
print(result)  # Output: ((9, 12), (9, 16))
```

#### Constraints
- The input tuples will always have the same structure.
- Each inner tuple will contain numeric values.
- The function should handle any depth of nesting as long as the structures of the two input tuples match.
def add_nested_tuples(tuple1, tuple2):
    """
    Perform index-wise addition of elements in two nested tuples.

    Args:
        tuple1 (tuple): The first nested tuple.
        tuple2 (tuple): The second nested tuple.

    Returns:
        tuple: A new nested tuple with index-wise added elements.
    """
    # Placeholder for the solution
    pass