# Problem Description
The problem requires implementing a matrix transformation function that takes a NxN input matrix and produces a NxN output matrix. The transformation appears to be a reflection or mirroring operation around a vertical axis that runs through the center of the matrix.

# Visual Facts
1. Matrix Properties:
   - Both input and output matrices are 4x4
   - Two example cases are shown
   - A green dotted line marks the vertical axis in the middle of input matrices
   - Black arrows show the transformation from input to output

2. First Example:
   - Input Matrix rows: 
     * [A, B, C, D]
     * [+, -, *, /]
     * [D, C, B, A]
     * [/, *, -, +]
   - Output Matrix rows:
     * [D, C, B, A]
     * [/, *, -, +]
     * [A, B, C, D]
     * [+, -, *, /]

3. Second Example:
   - Input Matrix rows:
     * [4, @, 1, 8]
     * [#, a, Q, E]
     * [9, ?, 6, &]
     * [b, $, F, t]
   - Output Matrix rows:
     * [8, 1, @, 4]
     * [E, Q, a, #]
     * [&, 6, ?, 9]
     * [t, F, $, b]

# Visual Patterns
1. Transformation Rules:
   - The matrix is reflected across the vertical line between columns 2 and 3
   - Each row in the input matrix becomes flipped horizontally in the output matrix
   - The relative positions of characters within each row remain in the same row, just reversed

2. Mathematical Properties:
   - For any element at position (i,j) in the input matrix, its new position in the output matrix is (i, n-1-j) where n is the matrix size (4)

3. Invariant Properties:
   - Matrix dimensions remain unchanged (4x4)
   - Content of the matrix remains the same, only positions change
   - The transformation applies consistently regardless of the type of characters (letters, numbers, or symbols)

# Solution
from typing import List

def solution(input_matrix: List[List[str]]) -> List[List[str]]:
    """
    Transform the input matrix based on the pattern shown in the figure
    
    Parameters:
        input_matrix (List[List[str]]): Input matrix as a 2d array.
    
    Returns:
        output_matrix (List[List[str]]): Output matrix as a 2d array.
    """
    new_matrix = [row[::-1] for row in input_matrix]
    
    return new_matrix


# Test Script
def test():
    test_cases = [
        [['1', '2', '3'], ['4', '#', '6'], ['D', '8', 'a']],
        [['1', 'a'], ['3', '#']],
        [['4', '@', '1', '8'], ['#', 'a', 'Q', '&'], ['9', '?', '&', '%'], ['b', '$', 'F', 't']],
        [['6', '@', '2', '1'], ['9', '#', 'Q', '1'], ['9', '4', '5', '4'], ['1', '1', '1', '1']],
        [['4', '2'], ['6', '9']],
        [['7', '8', '9'], ['+', '#', '_'], [')', '8', '$']],
        [['6', '@', '2', '1', '&'], ['9', '#', 'Q', '1', '@'], ['9', '4', '5', '4', '!'], ['1', '1', '1', '1', '?'], ['(', ')', '#', '%', '5']],
        [['6', '@', '2', '1', '&', ']'], ['9', '#', 'Q', '1', '@', '['], ['9', '4', '5', '4', '!', '='], ['1', '1', '1', '1', '?', '9'], ['(', ')', '#', '%', '5', '4'], ['(', '6', '#', '4', '5', '-']],
        [['!', '2', '$'], ['6', '!', '9'], ['+', '!', '-']],
        [['1', '1', '1'], ['2', '2', '2'], ['3', '3', '3']],
    ]

    for i, input_matrix in enumerate(test_cases):
        # Create deep copy of input matrix
        original_input_matrix = [row[:] for row in input_matrix]
        
        try:
            output = solution(input_matrix)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`input_matrix`: {original_input_matrix}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message

        # Create expected result by reversing each row
        expected_output = [row[::-1] for row in original_input_matrix]
        
        if output != expected_output:
            error_message = (
                f"The following Test Case failed:\n"
                f"`input_matrix`: {original_input_matrix}\n\n"
                f"Actual Output: {output}\n"
                f"Expected Output: {expected_output}"
            )
            assert False, error_message

test()