Which optimized DP pattern solves this lesson cleanly?
Practice this question from Longest Common Subsequence - 2D DP Pattern Practice Quiz, with options and an explanation.
Question
Which optimized DP pattern solves this lesson cleanly?
Option A — Correct answer
2D prefix DP, optimized to two rows.
Option B
Plain recursion without caching
Option C
Two pointers on a sorted array
Option D
Stack matching only
Explanation
2D prefix DP, optimized to two rows.