# Problem Description
The problem involves transforming an initial sequence of characters or numbers by shifting all elements one position to the right, with the last element moving to the first position. This transformation is akin to a circular rotation of the sequence.

# Visual Facts
1. **Example 1:**
   - Initial Sequence: `ABC`
   - Initial Status: Pointer at the first element `A`
   - Step 1: `A` is moved out, sequence becomes `BC`
   - Step 2: Pointer moves to `B`, sequence becomes `CAB`
   - Step 3: Pointer moves to `C`, sequence becomes `CAB`
   - Final Sequence: `CAB`

2. **Example 2:**
   - Initial Sequence: `1, 2, ..., N`
   - Initial Status: Pointer at the first element `1`
   - Step 1: Pointer moves to `N`
   - Step N: `N` is moved to the front, sequence becomes `N, 1, 2, ..., N-1`
   - Final Sequence: `N, 1, 2, ..., N-1`

# Visual Patterns
1. **Rotation Pattern:**
   - The last element of the sequence is moved to the front.
   - All other elements are shifted one position to the right.
   - This pattern is consistent in both examples provided.

2. **Pointer Movement:**
   - The pointer starts at the first element.
   - The pointer moves to the last element, which is then moved to the front.
   - The pointer then moves back to the first element of the new sequence.

3. **General Rule:**
   - For any sequence `S = [s1, s2, ..., sn]`, the transformation results in `S' = [sn, s1, s2, ..., sn-1]`.


# Solution
from typing import List

def solution(init_seq: List[str]) -> List[str]:
    """
    Transforms an initial sequence based on a pointer position according to specific rules.

    Args:
        init_seq: List of single characters representing the initial sequence

    Returns:
        List of single characters representing the transformed sequence
    """
    if not init_seq:
        return []
    return [init_seq[-1]] + init_seq[:-1]


# Test Script
def test():
    test_cases = [
        {
            "input": (["A", "B", "C"]),
            "expected":  ['C', 'A', 'B']
        },
        {
            "input": (["A", "B", "C", "D"]),
            "expected": ['D', 'A', 'B', 'C']
        },
        {
            "input": (["A", "D" ,"B", "C"]),
            "expected": ['C', 'A', 'D', 'B']
        },
        {
            "input": (["A"]),
            "expected": ['A']
        },
        {
            "input": (["A", "B"]),
            "expected": ['B', 'A']
        },
        {
            "input": (["A", "B", "C", "D"]),
            "expected": ['D', 'A', 'B', 'C']   
        },
        {
            "input": (["1", "2", "3", "4", "5"]),
            "expected": ['5', '1', '2', '3', '4']
        },
        {
            "input": (["1", "2", "3", "4", "5"]),
            "expected":  ['5', '1', '2', '3', '4']
        },
        {
            "input": (["1", "2", "3", "4", "5", "6"]),
            "expected": ['6', '1', '2', '3', '4', '5']
        },
        {
            "input": (["1", "2", "3", "4", "5", "7"]),
            "expected": ['7', '1', '2', '3', '4', '5']
        },

    ]
    
    for i, test_case in enumerate(test_cases):
        init_seq = test_case["input"]
        expected_output = test_case["expected"]
        
        try:
            output = solution(init_seq)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`init_seq`: {init_seq}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message

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

test()