def commonWords(hyp, pe):
    """
    This function computes the longest common subsequence between a translation hypothesis and
    its post-edited version. The function returns a list with the positions of the common words.
    """
    x_list = hyp.split()
    y_list = pe.split()
    m = len(x_list)
    n = len(y_list)
    x_path = [str(tr) for tr in range(m)]

    LCS = [['' for i in range(n + 1)] for j in range(m + 1)]
    LCS_xpath = [['' for i in range(n + 1)] for j in range(m + 1)]
    
    for i in range(m - 1, -1, -1):
        for j in range(n - 1, -1, -1):
            LCS[i][j] = LCS[i + 1][j + 1]
            LCS_xpath[i][j] = LCS_xpath[i + 1][j + 1]

            if x_list[i] == y_list[j]:
                LCS[i][j] += ' ' + x_list[i]
                LCS_xpath[i][j] += ' ' + x_path[i]

            if len(LCS[i][j + 1]) > len(LCS[i][j]):
                LCS[i][j] = LCS[i][j + 1]
                LCS_xpath[i][j] = LCS_xpath[i][j + 1]
                
            if len(LCS[i + 1][j]) > len(LCS[i][j]):
                LCS[i][j] = LCS[i + 1][j]
                LCS_xpath[i][j] = LCS_xpath[i + 1][j]
                
    return [int(index) for index in list(reversed(LCS_xpath[0][0].split()))]