← Back to Index

🧩 DP Visualizer

Longest Common Subsequence · Table Filling + Backtracking
0,0
Current Cell
-
Characters
0
LCS Length
-
Recovered LCS
Ready
Status
Current DP cell
Character match (diagonal + 1)
Take max from top/left
Backtracked LCS path

Step Log

How It Works

The Longest Common Subsequence DP table stores dp[i][j]: the LCS length between prefixes A[0..i-1] and B[0..j-1].