Problem 1143 · Medium
2D DP: dp[i][j] = dp[i-1][j-1]+1 on match, else max of dp[i-1][j] and dp[i][j-1].
Open the interactive visualisation