# Problem Description
This is a string manipulation problem where we need to transform an input string by replacing characters at odd-indexed positions with a specific pattern. The goal is to replace each character at odd indices (0-based indexing) with the string "abc" while keeping even-indexed characters unchanged.

# Visual Facts
1. Four examples are shown in the image:
   - Example 1: s = "a" → result = "a"
   - Example 2: s = "cat" → result = "cabct"
   - Example 3: s = "world" → result = "wabcrabcd"
   - Example 4: s = "freedom" → result = "fabceabcdabcm"

2. Input strings have varying lengths:
   - Single character ("a")
   - Three characters ("cat")
   - Five characters ("world")
   - Seven characters ("freedom")

3. Each example shows the input string and its corresponding transformed result

# Visual Patterns
1. Pattern for character replacement:
   - Every character at an odd-indexed position (0-based) is replaced with "abc"
   - Characters at even-indexed positions remain unchanged in their original positions

2. Transformation rules:
   * Even-indexed characters (0-based) stay in place
   * Odd-indexed characters (0-based) are replaced with "abc"


# Solution
def solution(s: str) -> str:
    """
    Modifies the input string according to a specified pattern.

    Parameters:
        s (str): The input string to modify.

    Returns:
        str: The modified string.
    """
    result = []
    target = 'abc'
    for i in range(len(s)):
        if i % 2 == 1:
            result.append(target)  # Replace the letter with target
        else:
            result.append(s[i])  # Keep the original letter
    return ''.join(result)


# Test Script
def test():
    test_cases = [
        ('a', 'a'),
        ('abc', 'aabcc'),
        ('hello', 'habclabco'),
        ('world', 'wabcrabcd'),
        ('cat', 'cabct'),
        ('string', 'sabcrabcnabc'),
        ('check', 'cabceabck'),
        ('ocuihoduhfoiaugfoiusdviusbdics', 'oabcuabchabcdabchabcoabcaabcgabcoabcuabcdabciabcsabcdabccabc'),
        ('csudgcisug1231387948rf9ewufha', 'cabcuabcgabciabcuabc1abc3abc3abc7abc4abcrabc9abcwabcfabca'),
        ('adiuevi0248ut9huodnfoir<><><;;eoifh1-=-s9uh`', 'aabciabceabciabc2abc8abctabchabcoabcnabcoabcrabc>abc>abc;abceabciabchabc-abc-abc9abchabc')
    ]

    for s, expected_output in test_cases:
        try:
            output = solution(s)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`s`: {s}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message
            
        if output != expected_output:
            error_message = (
                f"The following Test Case failed:\n"
                f"`s`: {s}\n\n"
                f"Actual Output: {output}\n"
                f"Expected Output: {expected_output}"
            )
            assert False, error_message

test()