$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · hard · #294

What goes in the blank?

// longest common subsequence table
dp[i][j] = a[i - 1] === b[j - 1]
  ? dp[i - 1][j - 1] + 1
  : Math.____(dp[i - 1][j], dp[i][j - 1]);

Answer: max (also accepted: max, Math.max)

When the characters differ, the best subsequence drops one of them, so take the larger neighbour.
Play Problem Solving ▸