function computeLcsTable(oldLines, newLines) {
  const m = oldLines.length;
  const n = newLines.length;
  const stride = n + 1;
  const dp = new Uint32Array((m + 1) * stride);
  for (let i = 1; i <= m; i++) {
    const oi = oldLines[i - 1];
    const rowBase = i * stride;
    const prevRowBase = rowBase - stride;
    for (let j = 1; j <= n; j++) {
      if (oi === newLines[j - 1]) {
        dp[rowBase + j] = dp[prevRowBase + (j - 1)] + 1;
      } else {
        const up = dp[prevRowBase + j];
        const left = dp[rowBase + (j - 1)];
        dp[rowBase + j] = up >= left ? up : left;
      }
    }
  }
  return dp;
}
function lcsAt(dp, i, j, stride) {
  return dp[i * stride + j];
}
export {
  computeLcsTable,
  lcsAt
};
//# sourceMappingURL=lcs.js.map