# Problem Description
This appears to be a problem about simulating two stacks (A and B) that change over time, where we need to calculate the height at a specific time point. The height seems to be calculated based on the heights of both stacks.

# Visual Facts
1. The image shows two stacks (Stack A in green and Stack B in blue) evolving over 4 time points (T=0 to T=3)
2. Initial state (T=0):
   - Stack A has 4 elements: [4,2,1,3]
   - Stack B has 5 elements: [5,4,2,1]
3. At each time step, one element is removed from the top of either stack
4. The two stakes have "h_a=X" and "h_b=X" written above them, indicating their respective heights
5. At each time step, the red font shows "height=h_a+h_b=XX", representing the sum of the heights of the two stakes
6. Time points are labeled T=0, T=1, T=2, and T=3

# Visual Patterns
1. Stack Operation Pattern:
   - Only the top elements of both stacks are removed per time step
   - At T=0: Stack A has 4 elements [4,2,1,3] and Stack B has 4 elements [5,4,2,1]
   - At T=1: Stack A has 3 elements [2,1,3] and Stack B has 3 elements [4,2,1]
   - At T=2: Stack A has 2 elements [1,3] and Stack B has 2 elements [2,1]
   - At T=3: Stack A has 1 element [3] and Stack B has 1 element [1]

2. Height Calculation Pattern:
   - The final "height" value is calculating sum(height_of_A, height_of_B) at each time step
   - At T=0, height_of_A=sum([4,2,1,3])=10 and height_of_B=sum([5,4,2,1])=12, so final height=22
   - At T=1, height_of_A=sum([2,1,3])=6 and height_of_B=sum([4,2,1])=7, so final height=13
   - At T=2, height_of_A=sum([1,3])=4 and height_of_B=sum([2,1])=3, so final height=7
   - At T=3, height_of_A=sum([3])=3 and height_of_B=sum([1])=1, so final height=4
   - So first need to calculate the sum of the elements in the stack and then calculate the sum of the two stacks.


# Solution
from typing import List

def solution(a: List[int], b: List[int], t: int) -> int:       
    """
    Calculate the hight at a specific time.

    Parameters:
        a (List[int]): A stack, where index 0 represents the top element.
        b (List[int]): B stack, where index 0 represents the top element.
        t (int): Time at which to calculate the hight.    

    Returns:
        int: The hight at time t.      
    """
    for current_time in range(t):
        if a:
            a.pop(0)
        if b:
            b.pop(0)

    return sum([sum(a), sum(b)])


# Test Script
def test():
    test_cases = [
        ([4, 2, 1, 3], [5, 5, 2, 1], 0, 23),
        ([4, 2, 1, 3], [5, 5, 2, 1], 1, 14),
        ([4, 2, 1, 3], [5, 4, 2, 1], 2, 7),
        ([4, 2, 1, 3], [5, 4, 2, 1], 3, 4),
        ([4, 2, 1, 3], [5, 4, 2, 1], 0, 22),
        ([4, 2, 1, 3], [5, 4, 2, 1], 1, 13),
        ([7, 4, 4, 2, 1, 3], [5, 4, 2, 1], 2, 13),
        ([1, 1, 3, 2, 1, 3], [5, 4, 2, 1], 3, 7),
        ([2, 2, 3, 2], [1, 2, 3], 0, 15),
        ([2, 2, 3, 2], [1, 2, 3], 2, 8)
    ]

    for a, b, t, expected_output in test_cases:
        try:
            output = solution(a, b, t)
        except Exception as e:
            error_message = (
                f"An exception occurred while running the test case:\n"
                f"`a`: {a}\n"
                f"`b`: {b}\n"
                f"`t`: {t}\n\n"
                f"Exception: '{str(e)}'"
            )
            assert False, error_message

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

test()