# Problem Description
The problem requires implementing a function that generates a character matrix based on a specific pattern. Given an input N, the function should create a matrix of size (2N)×(2N) filled with '+' and '-' characters arranged in 2×2 blocks following a specific alternating pattern. Each row of the output matrix should be returned as a string, and the entire matrix as a list of these strings.

# Visual Facts
1. Each matrix has dimensions of 2N × 2N where N is the input parameter:
   - N=1 produces a 2×2 matrix
   - N=2 produces a 4×4 matrix
   - N=3 produces a 6×6 matrix

2. The basic building block is a 2×2 square that contains the same symbol (either all '+' or all '-')

3. Each matrix consists of N×N blocks of 2×2 squares

4. For N=1:
   - All cells contain '+'

5. For N=2:
   - Top-left quadrant: all '+'
   - Top-right quadrant: all '-'
   - Bottom-left quadrant: all '-'
   - Bottom-right quadrant: all '+'

6. For N=3:
   - Pattern alternates between '+' and '-' blocks in both directions

# Visual Patterns
1. Matrix Size Pattern:
   - Final matrix size is always 2N × 2N
   - Matrix is made up of N × N blocks of 2×2 squares

2. Symbol Distribution Pattern:
   - Symbols alternate in a checkerboard pattern at the block level
   - Each 2×2 block is filled with the same symbol
   - Starting symbol in top-left is always '+'

3. Block Pattern:
   - When moving from one 2×2 block to an adjacent block (horizontally or vertically), the symbol alternates
   - The pattern repeats every 2 blocks in both directions


# Solution
from typing import List

def solution(N: int) -> List[str]:
    """
    Generates a character matrix of size N x N based on the pattern shown in the image.

    Parameters:
    N (int): The size of the matrix (both the number of rows and columns).

    Returns:
    List[str]: The generated character matrix, where each row is a string.
    """
    matrix = []
    for i in range(N * 2):
        row = []
        for j in range(N * 2):
            if (i // 2 + j // 2) % 2 == 0:
                row.append('+')
            else:
                row.append('-')
        matrix.append(''.join(row))
    return matrix


# Test Script
def test():
    test_cases = [
        (1, ['++', 
             '++']),
        (2, ['++--', 
             '++--', 
             '--++', 
             '--++']),
        (3, ['++--++', 
             '++--++', 
             '--++--', 
             '--++--', 
             '++--++', 
             '++--++']),
        (4, ['++--++--', 
             '++--++--', 
             '--++--++', 
             '--++--++', 
             '++--++--', 
             '++--++--', 
             '--++--++', 
             '--++--++']),
        (5, ['++--++--++', 
             '++--++--++', 
             '--++--++--', 
             '--++--++--', 
             '++--++--++', 
             '++--++--++', 
             '--++--++--', 
             '--++--++--', 
             '++--++--++', 
             '++--++--++'])
    ]
    for N, expected_output in test_cases:
        try:
            output = solution(N)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`N`: {N}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message

        if output != expected_output:
            error_message = (
                f"The following Test Case failed:\n"
                f"`N`: {N}\n\n"
                f"Actual Output: {output}\n"
                f"Expected Output: {expected_output}"
            )
            assert False, error_message

test()