from typing import List


def _reconstruct_longest_common_subsequence(x: str, y: str,
                                            dp: List[List[int]]) -> List[str]:
    """
    Private helper function to reconstruct the longest common subsequence
    according to the optimal solution using backtracking.
    :param x: str
    :param y: str
    :param dp: list[list[int]]
    :return: list[str]
    """
    lcs = []
    i, j = len(x), len(y)
    while i >= 1 and j >= 1:
        x_curr, y_curr = x[i - 1], y[j - 1]
        if x_curr == y_curr:
            lcs.insert(0, x_curr)
            i -= 1
            j -= 1
        else:
            if dp[i][j] == dp[i - 1][j]:
                i -= 1
            else:
                j -= 1
    return lcs
    # Running time complexity: O(m + n)